<commit_before>MAIN = get_flash_videos
COMBINE = utils/combine-perl.pl
VERSION := $(shell ./$(MAIN) --version 2>&1 | awk '{print $$3}')

TARGETS = combined-$(MAIN) combined-$(MAIN)-$(VERSION) \
	  $(MAIN)-$(VERSION) $(MAIN).1 $(MAIN).1.gz

default: $(MAIN)-$(VERSION)

all: $(TARGETS)

clean:
	rm -f $(TARGETS) .sitemodules

# Build the main get_flash_videos, by combining the modules and sites into one
# file, for easier download and installation.

$(MAIN)-$(VERSION): $(COMBINE) $(MAIN) FlashVideo/* .sitemodules \
  utils/combine-header
	$(COMBINE) --name="$(MAIN)" --include="^FlashVideo::" \
	  utils/combine-header .sitemodules $(MAIN) > $@
	chmod a+x $@

# This makes sure to 'use' all the Site modules, so that the combiner can pick
# them all up.

.sitemodules: FlashVideo/Site/*.pm
	ls $^ | sed -e 's!/!::!g' -e 's/\.pm$$/ ();/' -e 's/^/use /' > $@

# Build a combined version which also includes our dependencies, this makes it
# easier for people who cannot install Perl modules. (Note that it does still
# need HTML::Parser, as this is XS, and optionally XML::Simple, but LWP and
# Mechanize are included by this).

COMBINED_SOURCES = utils/combine-head .sitemodules $(MAIN)

combined-$(MAIN)-$(VERSION): combined-get_flash_videos
	cp -p $^ $@

combined-$(MAIN): $(COMBINE) $(COMBINED_SOURCES)
	$(COMBINE) --name="$@" $(COMBINED_SOURCES) > $@
	chmod a+x $@

# Run our Perl tests.
check: $(MAIN)-$(VERSION)
	SCRIPT=$^ prove t

# Manpage
$(MAIN).1: $(MAIN).pod
	pod2man -c "User commands" -r "$(MAIN)-$(VERSION)" $^ > $@

$(MAIN).1.gz: $(MAIN).1
	gzip -f $^

# Install
DESTDIR ?=
install: $(MAIN)-$(VERSION) $(MAIN).1.gz
	mkdir -p $(DESTDIR)/usr/bin
	cp -p $(MAIN)-$(VERSION) $(DESTDIR)/usr/bin/$(MAIN)
	mkdir -p $(DESTDIR)/usr/share/man/man1
	cp -p $(MAIN).1.gz $(DESTDIR)/usr/share/man/man1

# For project people to easily make releases.

# Put this in ~/bin:
#  http://code.google.com/p/support/source/browse/trunk/scripts/googlecode_upload.py

release: release-main deb
	svn commit -m "Version $(VERSION)" wiki/Installation.wiki wiki/Version.wiki

release-main: $(MAIN)-$(VERSION) changelog-update wiki-update release-combined
	googlecode_upload.py -l "Featured,OpSys-All" -s "Version $(VERSION)" -p get-flash-videos $<
	git commit -m "Version $(VERSION)" debian/changelog
	git tag -a -m "Version $(VERSION)" v$(VERSION)

release-combined: combined-$(MAIN)-$(VERSION)
	googlecode_upload.py -l "OpSys-All" -s "Version $(VERSION) -- combined version including some required modules." -p get-flash-videos $^

wiki:
	svn checkout https://get-flash-videos.googlecode.com/svn/wiki/ $@

changelog-update:
	@fgrep -q '$(MAIN) ($(VERSION)-1)' debian/changelog || dch -v $(VERSION)-1

wiki-update: wiki
	@cd wiki && svn up
	@perl -pi -e's/(get[-_]flash[-_]videos[-_])\d+\.\d+/$${1}$(VERSION)/g' wiki/Installation.wiki
	@perl -pi -e's/\d+\.\d+/$(VERSION)/g' wiki/Version.wiki
	@svn diff wiki/Installation.wiki wiki/Version.wiki | grep -q . || (echo "Version already released" && exit 1)
	@svn diff wiki/Installation.wiki wiki/Version.wiki && echo "OK? (ctrl-c to abort)" && read F<commit_msg>Add pushing tag to release process<commit_after>MAIN = get_flash_videos
COMBINE = utils/combine-perl.pl
VERSION := $(shell ./$(MAIN) --version 2>&1 | awk '{print $$3}')

TARGETS = combined-$(MAIN) combined-$(MAIN)-$(VERSION) \
	  $(MAIN)-$(VERSION) $(MAIN).1 $(MAIN).1.gz

default: $(MAIN)-$(VERSION)

all: $(TARGETS)

clean:
	rm -f $(TARGETS) .sitemodules

# Build the main get_flash_videos, by combining the modules and sites into one
# file, for easier download and installation.

$(MAIN)-$(VERSION): $(COMBINE) $(MAIN) FlashVideo/* .sitemodules \
  utils/combine-header
	$(COMBINE) --name="$(MAIN)" --include="^FlashVideo::" \
	  utils/combine-header .sitemodules $(MAIN) > $@
	chmod a+x $@

# This makes sure to 'use' all the Site modules, so that the combiner can pick
# them all up.

.sitemodules: FlashVideo/Site/*.pm
	ls $^ | sed -e 's!/!::!g' -e 's/\.pm$$/ ();/' -e 's/^/use /' > $@

# Build a combined version which also includes our dependencies, this makes it
# easier for people who cannot install Perl modules. (Note that it does still
# need HTML::Parser, as this is XS, and optionally XML::Simple, but LWP and
# Mechanize are included by this).

COMBINED_SOURCES = utils/combine-head .sitemodules $(MAIN)

combined-$(MAIN)-$(VERSION): combined-get_flash_videos
	cp -p $^ $@

combined-$(MAIN): $(COMBINE) $(COMBINED_SOURCES)
	$(COMBINE) --name="$@" $(COMBINED_SOURCES) > $@
	chmod a+x $@

# Run our Perl tests.
check: $(MAIN)-$(VERSION)
	SCRIPT=$^ prove t

# Manpage
$(MAIN).1: $(MAIN).pod
	pod2man -c "User commands" -r "$(MAIN)-$(VERSION)" $^ > $@

$(MAIN).1.gz: $(MAIN).1
	gzip -f $^

# Install
DESTDIR ?=
install: $(MAIN)-$(VERSION) $(MAIN).1.gz
	mkdir -p $(DESTDIR)/usr/bin
	cp -p $(MAIN)-$(VERSION) $(DESTDIR)/usr/bin/$(MAIN)
	mkdir -p $(DESTDIR)/usr/share/man/man1
	cp -p $(MAIN).1.gz $(DESTDIR)/usr/share/man/man1

# For project people to easily make releases.

# Put this in ~/bin:
#  http://code.google.com/p/support/source/browse/trunk/scripts/googlecode_upload.py

release: release-main deb
	svn commit -m "Version $(VERSION)" wiki/Installation.wiki wiki/Version.wiki

release-main: $(MAIN)-$(VERSION) changelog-update wiki-update release-combined
	googlecode_upload.py -l "Featured,OpSys-All" -s "Version $(VERSION)" -p get-flash-videos $<
	git commit -m "Version $(VERSION)" debian/changelog
	git tag -a -m "Version $(VERSION)" v$(VERSION)
	git push origin v$(VERSION)

release-combined: combined-$(MAIN)-$(VERSION)
	googlecode_upload.py -l "OpSys-All" -s "Version $(VERSION) -- combined version including some required modules." -p get-flash-videos $^

wiki:
	svn checkout https://get-flash-videos.googlecode.com/svn/wiki/ $@

changelog-update:
	@fgrep -q '$(MAIN) ($(VERSION)-1)' debian/changelog || dch -v $(VERSION)-1

wiki-update: wiki
	@cd wiki && svn up
	@perl -pi -e's/(get[-_]flash[-_]videos[-_])\d+\.\d+/$${1}$(VERSION)/g' wiki/Installation.wiki
	@perl -pi -e's/\d+\.\d+/$(VERSION)/g' wiki/Version.wiki
	@svn diff wiki/Installation.wiki wiki/Version.wiki | grep -q . || (echo "Version already released" && exit 1)
	@svn diff wiki/Installation.wiki wiki/Version.wiki && echo "OK? (ctrl-c to abort)" && read F
{'fraction_non_alphanumeric': 0.19106342088404868, 'fraction_numerical': 0.005445227418321589, 'mean_word_length': 4.081366965012205, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6548715', 'n_tokens_mistral': 2379, 'n_tokens_neox': 2244, 'n_words': 610}