Skip to content

Commit

Permalink
lib/Makefile.am: filter .git directories from source tarball
Browse files Browse the repository at this point in the history
The `smuxi-1.1.tar.gz` tarballs contains a range of `.git` directories and files
that shouldn't be there as this is a tarball based source distribution.

This created a problem in Debian where `gbp import-orig smuxi-1.1.tar.gz` was
missing the files underneath `lib/SmartIrc4net` as it contained a full blown
git repo within the tarball.

The "dist-hook" automake target is used to filter such things from the resulting
source tarball that got included via the magic EXTRA_DIST variable.

The following `.git` files and directories are now removed from the tarball:

    ./lib/SmartIrc4net/.git
    ./lib/SmartIrc4net/src/starksoftproxy/.git
    ./lib/StarkSoftProxy/.git
    ./lib/agsxmpp/agsxmpp/starksoftproxy/.git
  • Loading branch information
meebey committed Feb 12, 2021
1 parent 1d46a4b commit b047648
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -312,3 +312,11 @@ if BUNDLE_DB4O
# $(XBUILD) $(DB4O_NQ_XBUILD_FLAGS) /t:Clean $(DB4O_NQ_BUILD_FILE)
endif

# filter all .git files/directories from tarball
dist-hook:
for GIT_DIR in $$(find $(distdir) -name ".git"); do \
echo "filtering $$GIT_DIR from tarball..."; \
chmod -R u+w $(distdir)/$$GIR_DIR; \
rm -rf $$GIT_DIR; \
done

0 comments on commit b047648

Please sign in to comment.