<commit_before>PROG=cfgtrack

install:
	cp cfgtrack /usr/bin/cfgtrack
	cp cfgtrack_mail /usr/bin/cfgtrack_mail
	gzip -c cfgtrack.1 > /usr/share/man/man1/cfgtrack.1.gz

uninstall:
	rm /usr/share/man/man1/cfgtrack.1.gz
	rm /usr/bin/cfgtrack_mail
	rm /usr/bin/cfgtrack
	echo "To remove configuration for cfgtrack, rm -rf /var/lib/cfgtrack/"

release: release_src release_deb release_rpm

release_src:
	@echo "Making release for version $(REL_VERSION)"

	@if [ -z "$(REL_VERSION)" ]; then echo "REL_VERSION required"; exit 1; fi

	# Prepare source
	rm -rf $(PROG)-$(REL_VERSION)
	mkdir $(PROG)-$(REL_VERSION)
	cp src/cfgtrack $(PROG)-$(REL_VERSION)/
	cp src/cfgtrack_mail $(PROG)-$(REL_VERSION)/
	cp src/cfgtrack.1 $(PROG)-$(REL_VERSION)/
	cp LICENSE.txt $(PROG)-$(REL_VERSION)/
	cp README.md $(PROG)-$(REL_VERSION)/
	cp contrib/release_Makefile $(PROG)-$(REL_VERSION)/Makefile

	# Bump version numbers
	find $(PROG)-$(REL_VERSION)/ -type f -print0 | xargs -0 sed -i "s/%%VERSION%%/$(REL_VERSION)/g" 

	# Create archives
	zip -r $(PROG)-$(REL_VERSION).zip $(PROG)-$(REL_VERSION)
	tar -vczf $(PROG)-$(REL_VERSION).tar.gz  $(PROG)-$(REL_VERSION)

release_deb:
	@if [ -z "$(REL_VERSION)" ]; then echo "REL_VERSION required"; exit 1; fi

	mkdir -p rel_deb/usr/bin
	mkdir -p rel_deb/usr/share/doc/$(PROG)
	mkdir -p rel_deb/usr/share/man/man1

	# Copy the source to the release directory structure.
	cp LICENSE.txt rel_deb/usr/share/doc/$(PROG)
	cp README.md rel_deb/usr/share/doc/$(PROG)
	cp src/$(PROG) rel_deb/usr/bin/$(PROG)
	cp src/$(PROG).1 rel_deb/usr/share/man/man1
	cp src/cfgtrack_mail rel_deb/usr/bin/
	cp -ar contrib/debian/DEBIAN rel_deb/

	# Bump version numbers
	find rel_deb/ -type f -print0 | xargs -0 sed -i "s/%%VERSION%%/$(REL_VERSION)/g" 

	# Create debian pacakge
	fakeroot dpkg-deb --build rel_deb > /dev/null
	mv rel_deb.deb $(PROG)-$(REL_VERSION).deb

	# Cleanup
clean:
	rm -rf *.tar.gz
	rm -rf *.zip
	rm -rf *.deb
	rm -rf rel_deb
	rm -rf cfgtrack-*<commit_msg>Making new release now also builds an RPM package from the debian package using Alien.<commit_after>PROG=cfgtrack

install:
	cp cfgtrack /usr/bin/cfgtrack
	cp cfgtrack_mail /usr/bin/cfgtrack_mail
	gzip -c cfgtrack.1 > /usr/share/man/man1/cfgtrack.1.gz

uninstall:
	rm /usr/share/man/man1/cfgtrack.1.gz
	rm /usr/bin/cfgtrack_mail
	rm /usr/bin/cfgtrack
	echo "To remove configuration for cfgtrack, rm -rf /var/lib/cfgtrack/"

release: release_src release_deb release_rpm

release_src:
	@echo "Making release for version $(REL_VERSION)"

	@if [ -z "$(REL_VERSION)" ]; then echo "REL_VERSION required"; exit 1; fi

	# Prepare source
	rm -rf $(PROG)-$(REL_VERSION)
	mkdir $(PROG)-$(REL_VERSION)
	cp src/cfgtrack $(PROG)-$(REL_VERSION)/
	cp src/cfgtrack_mail $(PROG)-$(REL_VERSION)/
	cp src/cfgtrack.1 $(PROG)-$(REL_VERSION)/
	cp LICENSE.txt $(PROG)-$(REL_VERSION)/
	cp README.md $(PROG)-$(REL_VERSION)/
	cp contrib/release_Makefile $(PROG)-$(REL_VERSION)/Makefile

	# Bump version numbers
	find $(PROG)-$(REL_VERSION)/ -type f -print0 | xargs -0 sed -i "s/%%VERSION%%/$(REL_VERSION)/g" 

	# Create archives
	zip -r $(PROG)-$(REL_VERSION).zip $(PROG)-$(REL_VERSION)
	tar -vczf $(PROG)-$(REL_VERSION).tar.gz  $(PROG)-$(REL_VERSION)

	# Cleanup
	rm -rf $(PROG)-$(REL_VERSION)

release_deb:
	@if [ -z "$(REL_VERSION)" ]; then echo "REL_VERSION required"; exit 1; fi

	mkdir -p rel_deb/usr/bin
	mkdir -p rel_deb/usr/share/doc/$(PROG)
	mkdir -p rel_deb/usr/share/man/man1

	# Copy the source to the release directory structure.
	cp LICENSE.txt rel_deb/usr/share/doc/$(PROG)
	cp README.md rel_deb/usr/share/doc/$(PROG)
	cp src/$(PROG) rel_deb/usr/bin/$(PROG)
	cp src/$(PROG).1 rel_deb/usr/share/man/man1
	cp src/cfgtrack_mail rel_deb/usr/bin/
	cp -ar contrib/debian/DEBIAN rel_deb/

	# Bump version numbers
	find rel_deb/ -type f -print0 | xargs -0 sed -i "s/%%VERSION%%/$(REL_VERSION)/g" 

	# Create debian pacakge
	fakeroot dpkg-deb --build rel_deb > /dev/null
	mv rel_deb.deb $(PROG)-$(REL_VERSION).deb

	# Cleanup
	rm -rf rel_deb

release_rpm: release_deb
	alien -r cfgtrack-$(REL_VERSION).deb

clean:
	rm -rf *.tar.gz
	rm -rf *.zip
	rm -rf *.deb
	rm -rf rel_deb
	rm -rf cfgtrack-*
{'fraction_non_alphanumeric': 0.16003856350927934, 'fraction_numerical': 0.0072306579898770785, 'mean_word_length': 3.8823529411764706, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '27167', 'n_tokens_mistral': 1734, 'n_tokens_neox': 1627, 'n_words': 395}