<commit_before>RPM_ARCHITECTURE = x86_64
HEROKUISH_RPM_PACKAGE_NAME = herokuish-$(HEROKUISH_VERSION)-1.$(RPM_ARCHITECTURE).rpm
PLUGN_RPM_PACKAGE_NAME = plugn-$(PLUGN_VERSION)-1.$(RPM_ARCHITECTURE).rpm
SSHCOMMAND_RPM_PACKAGE_NAME = sshcommand-$(SSHCOMMAND_VERSION)-1.$(RPM_ARCHITECTURE).rpm
SIGIL_RPM_PACKAGE_NAME = gliderlabs-sigil-$(SIGIL_VERSION)-1.$(RPM_ARCHITECTURE).rpm

.PHONY: rpm-all

rpm-all: rpm-setup rpm-herokuish rpm-dokku rpm-plugn rpm-sshcommand rpm-sigil
	mv /tmp/*.rpm .
	@echo "Done"

rpm-setup:
	@echo "-> Installing rpm build requirements"
	@sudo apt-get update -qq > /dev/null
	@sudo DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true apt-get install -qq -y gcc git build-essential wget ruby-dev ruby1.9.1 rpm > /dev/null 2>&1
	@command -v fpm > /dev/null || sudo gem install fpm --no-ri --no-rdoc
	@ssh -o StrictHostKeyChecking=no git@github.com || true

rpm-herokuish:
	rm -rf /tmp/tmp /tmp/build $(HEROKUISH_RPM_PACKAGE_NAME)
	mkdir -p /tmp/tmp /tmp/build

	@echo "-> Cloning repository"
	git clone -q "https://github.com/$(HEROKUISH_REPO_NAME).git" \
		--branch "v$(HEROKUISH_VERSION)" /tmp/tmp/herokuish > /dev/null
	rm -rf /tmp/tmp/herokuish/.git /tmp/tmp/herokuish/.gitignore

	@echo "-> Copying files into place"
	mkdir -p "/tmp/build/var/lib"
	cp -rf /tmp/tmp/herokuish /tmp/build/var/lib/herokuish

	@echo "-> Creating $(HEROKUISH_RPM_PACKAGE_NAME)"
	sudo fpm -t rpm -s dir -C /tmp/build -n herokuish \
		-v $(HEROKUISH_VERSION) \
		-a $(RPM_ARCHITECTURE) \
		-p $(HEROKUISH_RPM_PACKAGE_NAME) \
		--depends 'docker-engine >= 1.9.1' \
		--depends 'sudo' \
		--after-install rpm/herokuish.postinst \
		--url "https://github.com/$(HEROKUISH_REPO_NAME)" \
		--description $(HEROKUISH_DESCRIPTION) \
		--license 'MIT License' \
		.
	mv *.rpm /tmp

rpm-dokku:
	rm -rf /tmp/tmp /tmp/build dokku_*_$(RPM_ARCHITECTURE).rpm
	mkdir -p /tmp/tmp /tmp/build

	mkdir -p /tmp/build/usr/bin
	mkdir -p /tmp/build/usr/share/doc/dokku
	mkdir -p /tmp/build/usr/share/dokku/contrib
	mkdir -p /tmp/build/usr/share/lintian/overrides
	mkdir -p /tmp/build/usr/share/man/man1
	mkdir -p /tmp/build/var/lib/dokku/core-plugins/available

	cp dokku /tmp/build/usr/bin
	cp LICENSE /tmp/build/usr/share/doc/dokku/copyright
	find . -name ".DS_Store" -depth -exec rm {} \;
	$(MAKE) go-build
	cp common.mk /tmp/build/var/lib/dokku/core-plugins/common.mk
	cp -r plugins/* /tmp/build/var/lib/dokku/core-plugins/available
	find plugins/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read plugin; do cd /tmp/build/var/lib/dokku/core-plugins/available/$$plugin && if [ -e Makefile ]; then $(MAKE) src-clean; fi; done
	find plugins/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read plugin; do touch /tmp/build/var/lib/dokku/core-plugins/available/$$plugin/.core; done
	rm /tmp/build/var/lib/dokku/core-plugins/common.mk
	$(MAKE) help2man
	$(MAKE) addman
	cp /usr/local/share/man/man1/dokku.1 /tmp/build/usr/share/man/man1/dokku.1
	gzip -9 /tmp/build/usr/share/man/man1/dokku.1
	cp contrib/dokku-installer.py /tmp/build/usr/share/dokku/contrib
ifeq ($(DOKKU_VERSION),master)
	git describe --tags > /tmp/build/var/lib/dokku/VERSION
else
	echo $(DOKKU_VERSION) > /tmp/build/var/lib/dokku/VERSION
endif
	cat /tmp/build/var/lib/dokku/VERSION | cut -d '-' -f 1 | cut -d 'v' -f 2 > /tmp/build/var/lib/dokku/STABLE_VERSION
ifneq (,$(findstring false,$(IS_RELEASE)))
	sed -i.bak -e "s/^/`date +%s`-/" /tmp/build/var/lib/dokku/STABLE_VERSION && rm /tmp/build/var/lib/dokku/STABLE_VERSION.bak
endif
ifdef DOKKU_GIT_REV
	echo "$(DOKKU_GIT_REV)" > /tmp/build/var/lib/dokku/GIT_REV
else
	git rev-parse HEAD > /tmp/build/var/lib/dokku/GIT_REV
endif

	@echo "-> Creating rpm package"
	VERSION=$$(cat /tmp/build/var/lib/dokku/STABLE_VERSION); \
	sudo fpm -t rpm -s dir -C /tmp/build -n dokku \
		-v "$$VERSION" \
		-a $(RPM_ARCHITECTURE) \
		-p "dokku-$$VERSION-1.x86_64.rpm" \
		--depends 'git' \
		--depends 'make' \
		--depends 'curl' \
		--depends 'gcc' \
		--depends 'man-db' \
		--depends 'sshcommand' \
		--depends 'gliderlabs-sigil' \
		--depends 'docker-engine >= 1.9.1' \
		--depends 'bind-utils' \
		--depends 'nginx' \
		--depends 'plugn' \
		--depends 'sudo' \
		--depends 'python' \
		--depends 'nc' \
		--after-install rpm/dokku.postinst \
		--url "https://github.com/$(DOKKU_REPO_NAME)" \
		--description $(DOKKU_DESCRIPTION) \
		--license 'MIT License' \
		.
	mv *.rpm "/tmp/dokku-`cat /tmp/build/var/lib/dokku/VERSION`-1.$(RPM_ARCHITECTURE).rpm"

rpm-plugn:
	rm -rf /tmp/tmp /tmp/build $(PLUGN_RPM_PACKAGE_NAME)
	mkdir -p /tmp/tmp /tmp/build /tmp/build/usr/bin
<commit_msg>fix: use or statements to add support for new docker packages<commit_after>RPM_ARCHITECTURE = x86_64
HEROKUISH_RPM_PACKAGE_NAME = herokuish-$(HEROKUISH_VERSION)-1.$(RPM_ARCHITECTURE).rpm
PLUGN_RPM_PACKAGE_NAME = plugn-$(PLUGN_VERSION)-1.$(RPM_ARCHITECTURE).rpm
SSHCOMMAND_RPM_PACKAGE_NAME = sshcommand-$(SSHCOMMAND_VERSION)-1.$(RPM_ARCHITECTURE).rpm
SIGIL_RPM_PACKAGE_NAME = gliderlabs-sigil-$(SIGIL_VERSION)-1.$(RPM_ARCHITECTURE).rpm

.PHONY: rpm-all

rpm-all: rpm-setup rpm-herokuish rpm-dokku rpm-plugn rpm-sshcommand rpm-sigil
	mv /tmp/*.rpm .
	@echo "Done"

rpm-setup:
	@echo "-> Installing rpm build requirements"
	@sudo apt-get update -qq > /dev/null
	@sudo DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true apt-get install -qq -y gcc git build-essential wget ruby-dev ruby1.9.1 rpm > /dev/null 2>&1
	@command -v fpm > /dev/null || sudo gem install fpm --no-ri --no-rdoc
	@ssh -o StrictHostKeyChecking=no <EMAIL>@github.com || true

rpm-herokuish:
	rm -rf /tmp/tmp /tmp/build $(HEROKUISH_RPM_PACKAGE_NAME)
	mkdir -p /tmp/tmp /tmp/build

	@echo "-> Cloning repository"
	git clone -q "https://github.com/$(HEROKUISH_REPO_NAME).git" \
		--branch "v$(HEROKUISH_VERSION)" /tmp/tmp/herokuish > /dev/null
	rm -rf /tmp/tmp/herokuish/.git /tmp/tmp/herokuish/.gitignore

	@echo "-> Copying files into place"
	mkdir -p "/tmp/build/var/lib"
	cp -rf /tmp/tmp/herokuish /tmp/build/var/lib/herokuish

	@echo "-> Creating $(HEROKUISH_RPM_PACKAGE_NAME)"
	sudo fpm -t rpm -s dir -C /tmp/build -n herokuish \
		-v $(HEROKUISH_VERSION) \
		-a $(RPM_ARCHITECTURE) \
		-p $(HEROKUISH_RPM_PACKAGE_NAME) \
		--depends 'docker-engine >= 1.9.1' \
		--depends 'sudo' \
		--after-install rpm/herokuish.postinst \
		--url "https://github.com/$(HEROKUISH_REPO_NAME)" \
		--description $(HEROKUISH_DESCRIPTION) \
		--license 'MIT License' \
		.
	mv *.rpm /tmp

rpm-dokku:
	rm -rf /tmp/tmp /tmp/build dokku_*_$(RPM_ARCHITECTURE).rpm
	mkdir -p /tmp/tmp /tmp/build

	mkdir -p /tmp/build/usr/bin
	mkdir -p /tmp/build/usr/share/doc/dokku
	mkdir -p /tmp/build/usr/share/dokku/contrib
	mkdir -p /tmp/build/usr/share/lintian/overrides
	mkdir -p /tmp/build/usr/share/man/man1
	mkdir -p /tmp/build/var/lib/dokku/core-plugins/available

	cp dokku /tmp/build/usr/bin
	cp LICENSE /tmp/build/usr/share/doc/dokku/copyright
	find . -name ".DS_Store" -depth -exec rm {} \;
	$(MAKE) go-build
	cp common.mk /tmp/build/var/lib/dokku/core-plugins/common.mk
	cp -r plugins/* /tmp/build/var/lib/dokku/core-plugins/available
	find plugins/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read plugin; do cd /tmp/build/var/lib/dokku/core-plugins/available/$$plugin && if [ -e Makefile ]; then $(MAKE) src-clean; fi; done
	find plugins/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read plugin; do touch /tmp/build/var/lib/dokku/core-plugins/available/$$plugin/.core; done
	rm /tmp/build/var/lib/dokku/core-plugins/common.mk
	$(MAKE) help2man
	$(MAKE) addman
	cp /usr/local/share/man/man1/dokku.1 /tmp/build/usr/share/man/man1/dokku.1
	gzip -9 /tmp/build/usr/share/man/man1/dokku.1
	cp contrib/dokku-installer.py /tmp/build/usr/share/dokku/contrib
ifeq ($(DOKKU_VERSION),master)
	git describe --tags > /tmp/build/var/lib/dokku/VERSION
else
	echo $(DOKKU_VERSION) > /tmp/build/var/lib/dokku/VERSION
endif
	cat /tmp/build/var/lib/dokku/VERSION | cut -d '-' -f 1 | cut -d 'v' -f 2 > /tmp/build/var/lib/dokku/STABLE_VERSION
ifneq (,$(findstring false,$(IS_RELEASE)))
	sed -i.bak -e "s/^/`date +%s`-/" /tmp/build/var/lib/dokku/STABLE_VERSION && rm /tmp/build/var/lib/dokku/STABLE_VERSION.bak
endif
ifdef DOKKU_GIT_REV
	echo "$(DOKKU_GIT_REV)" > /tmp/build/var/lib/dokku/GIT_REV
else
	git rev-parse HEAD > /tmp/build/var/lib/dokku/GIT_REV
endif

	@echo "-> Creating rpm package"
	VERSION=$$(cat /tmp/build/var/lib/dokku/STABLE_VERSION); \
	sudo fpm -t rpm -s dir -C /tmp/build -n dokku \
		-v "$$VERSION" \
		-a $(RPM_ARCHITECTURE) \
		-p "dokku-$$VERSION-1.x86_64.rpm" \
		--depends 'git' \
		--depends 'make' \
		--depends 'curl' \
		--depends 'gcc' \
		--depends 'man-db' \
		--depends 'sshcommand' \
		--depends 'gliderlabs-sigil' \
		--depends 'docker-engine >= 1.9.1 | docker-engine-cs >= 1.9.1 | docker-ce | docker-ee' \
		--depends 'bind-utils' \
		--depends 'nginx' \
		--depends 'plugn' \
		--depends 'sudo' \
		--depends 'python' \
		--depends 'nc' \
		--after-install rpm/dokku.postinst \
		--url "https://github.com/$(DOKKU_REPO_NAME)" \
		--description $(DOKKU_DESCRIPTION) \
		--license 'MIT License' \
		.
	mv *.rpm "/tmp/dokku-`cat /tmp/build/var/lib/dokku/VERSION`-1.$(RPM_ARCHITECTURE).rpm"

rpm-plugn:
	rm -rf /tmp/tmp /tmp/build $(PLUGN_RPM_PACKAGE_NAME)
	mkdir -p /tmp/tmp /tmp/build /tmp/build/usr/bin

{'fraction_non_alphanumeric': 0.1712564543889845, 'fraction_numerical': 0.008928571428571428, 'mean_word_length': 3.2863070539419086, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 39, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '5113255', 'n_tokens_mistral': 4181, 'n_tokens_neox': 3946, 'n_words': 742}