From 9e2044090d25a7cb704e81303734af81fcb20c8c Mon Sep 17 00:00:00 2001 From: Nico Kadel-Garcia Date: Sun, 2 May 2021 17:20:46 -0400 Subject: [PATCH 01/11] Add *.gz, *.zip, *.out, *~, *\#*, and *.spec to .gitignore --- .gitignore | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index dee5c091..cf79e172 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,13 @@ -/amazon-efs-utils* -!amazon-efs-utils.spec - +*.gz +*.orig +*.out +*.pyc +*.spec +*\#* +*~ +.DS_Store .coverage .pytest_cache - -*.pyc - +/*efs-utils*/ __pycache__/ build/ - -.DS_Store From 2543fb62cd68b2e62a98a5ffca3b249395f2786d Mon Sep 17 00:00:00 2001 From: Nico Kadel-Garcia Date: Sun, 2 May 2021 17:22:11 -0400 Subject: [PATCH 02/11] Move amazon-efs-utils.spec.in to amazon-efs-utils.spec --- amazon-efs-utils.spec => amazon-efs-utils.spec.in | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename amazon-efs-utils.spec => amazon-efs-utils.spec.in (100%) diff --git a/amazon-efs-utils.spec b/amazon-efs-utils.spec.in similarity index 100% rename from amazon-efs-utils.spec rename to amazon-efs-utils.spec.in From faebae20b4acfdaf2cad1180ef6327b14a60e1db Mon Sep 17 00:00:00 2001 From: Nico Kadel-Garcia Date: Sun, 2 May 2021 17:28:55 -0400 Subject: [PATCH 03/11] Handle tarballs as $(PACKAGE_NAME)-$(VERSION) --- Makefile | 44 ++++++++++++++++++++++++---------------- amazon-efs-utils.spec.in | 18 ++++++++-------- 2 files changed, 35 insertions(+), 27 deletions(-) diff --git a/Makefile b/Makefile index fd48bfc1..8939da03 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,8 @@ # PACKAGE_NAME = amazon-efs-utils -SOURCE_TARBALL = $(PACKAGE_NAME).tar.gz +VERSION = 1.30.2 +SOURCE_TARBALL = $(PACKAGE_NAME)-$(VERSION).tar.gz SPECFILE = $(PACKAGE_NAME).spec BUILD_DIR = build/rpmbuild export PYTHONPATH := $(shell pwd)/src @@ -16,36 +17,43 @@ export PYTHONPATH := $(shell pwd)/src clean: rm -rf $(BUILD_DIR) rm -rf $(PACKAGE_NAME) - rm -f $(SOURCE_TARBALL) + rm -f *.gz + rm -f *.spec .PHONY: tarball tarball: clean - mkdir -p $(PACKAGE_NAME) + mkdir -p $(PACKAGE_NAME)-$(VERSION) - mkdir -p $(PACKAGE_NAME)/dist - cp -p dist/amazon-efs-mount-watchdog.conf $(PACKAGE_NAME)/dist - cp -p dist/amazon-efs-mount-watchdog.service $(PACKAGE_NAME)/dist - cp -p dist/efs-utils.conf $(PACKAGE_NAME)/dist - cp -p dist/efs-utils.crt $(PACKAGE_NAME)/dist + mkdir -p $(PACKAGE_NAME)-$(VERSION)/dist + cp -p dist/amazon-efs-mount-watchdog.conf $(PACKAGE_NAME)-$(VERSION)/dist + cp -p dist/amazon-efs-mount-watchdog.service $(PACKAGE_NAME)-$(VERSION)/dist + cp -p dist/efs-utils.conf $(PACKAGE_NAME)-$(VERSION)/dist + cp -p dist/efs-utils.crt $(PACKAGE_NAME)-$(VERSION)/dist - mkdir -p $(PACKAGE_NAME)/src - cp -rp src/mount_efs $(PACKAGE_NAME)/src - cp -rp src/watchdog $(PACKAGE_NAME)/src + mkdir -p $(PACKAGE_NAME)-$(VERSION)/src + cp -rp src/mount_efs $(PACKAGE_NAME)-$(VERSION)/src + cp -rp src/watchdog $(PACKAGE_NAME)-$(VERSION)/src - mkdir -p ${PACKAGE_NAME}/man - cp -rp man/mount.efs.8 ${PACKAGE_NAME}/man + mkdir -p ${PACKAGE_NAME}-$(VERSION)/man + cp -rp man/mount.efs.8 ${PACKAGE_NAME}-$(VERSION)/man - tar -czf $(SOURCE_TARBALL) $(PACKAGE_NAME)/* + tar -czf $(SOURCE_TARBALL) $(PACKAGE_NAME)-$(VERSION)/* .PHONY: sources sources: tarball +.PHONLY: $(SPECFILE) +$(SPECFILE): $(SPECFILE).in + sed 's/^Version:.*/Version: $(VERSION)/g' $? > $@ + .PHONY: rpm-only -rpm-only: +rpm-only:: $(TARBALL) +rpm-only:: $(SPECFILE) mkdir -p $(BUILD_DIR)/{SPECS,COORD_SOURCES,DATA_SOURCES,BUILD,RPMS,SOURCES,SRPMS} - cp $(SPECFILE) $(BUILD_DIR)/SPECS - cp $(SOURCE_TARBALL) $(BUILD_DIR)/SOURCES - rpmbuild -ba --define "_topdir `pwd`/$(BUILD_DIR)" $(BUILD_DIR)/SPECS/$(SPECFILE) + rpmbuild -ba \ + --define "_topdir `pwd`/$(BUILD_DIR)" \ + --define '_sourcedir $(PWD)' \ + $(SPECFILE) cp $(BUILD_DIR)/RPMS/*/*rpm build .PHONY: rpm diff --git a/amazon-efs-utils.spec.in b/amazon-efs-utils.spec.in index 3d7c2397..c593b268 100644 --- a/amazon-efs-utils.spec.in +++ b/amazon-efs-utils.spec.in @@ -60,22 +60,22 @@ Requires(preun) : /sbin/service /sbin/chkconfig Requires(postun) : /sbin/service %endif -Source : %{name}.tar.gz +Source : %{name}-%{version}.tar.gz %description This package provides utilities for simplifying the use of EFS file systems %prep -%setup -n %{name} +%setup -n %{name}-%{version} %install mkdir -p %{buildroot}%{_sysconfdir}/amazon/efs %if %{with_systemd} mkdir -p %{buildroot}%{_unitdir} -install -p -m 644 %{_builddir}/%{name}/dist/amazon-efs-mount-watchdog.service %{buildroot}%{_unitdir} +install -p -m 644 dist/amazon-efs-mount-watchdog.service %{buildroot}%{_unitdir} %else mkdir -p %{buildroot}%{_sysconfdir}/init -install -p -m 644 %{_builddir}/%{name}/dist/amazon-efs-mount-watchdog.conf %{buildroot}%{_sysconfdir}/init +install -p -m 644 dist/amazon-efs-mount-watchdog.conf %{buildroot}%{_sysconfdir}/init %endif mkdir -p %{buildroot}/sbin @@ -83,11 +83,11 @@ mkdir -p %{buildroot}%{_bindir} mkdir -p %{buildroot}%{_localstatedir}/log/amazon/efs mkdir -p %{buildroot}%{_mandir}/man8 -install -p -m 644 %{_builddir}/%{name}/dist/efs-utils.conf %{buildroot}%{_sysconfdir}/amazon/efs -install -p -m 444 %{_builddir}/%{name}/dist/efs-utils.crt %{buildroot}%{_sysconfdir}/amazon/efs -install -p -m 755 %{_builddir}/%{name}/src/mount_efs/__init__.py %{buildroot}/sbin/mount.efs -install -p -m 755 %{_builddir}/%{name}/src/watchdog/__init__.py %{buildroot}%{_bindir}/amazon-efs-mount-watchdog -install -p -m 644 %{_builddir}/%{name}/man/mount.efs.8 %{buildroot}%{_mandir}/man8 +install -p -m 644 dist/efs-utils.conf %{buildroot}%{_sysconfdir}/amazon/efs +install -p -m 444 dist/efs-utils.crt %{buildroot}%{_sysconfdir}/amazon/efs +install -p -m 755 src/mount_efs/__init__.py %{buildroot}/sbin/mount.efs +install -p -m 755 src/watchdog/__init__.py %{buildroot}%{_bindir}/amazon-efs-mount-watchdog +install -p -m 644 man/mount.efs.8 %{buildroot}%{_mandir}/man8 %files %defattr(-,root,root,-) From d11a6ceeabaf66607b036f09f80421ad1a3a1a00 Mon Sep 17 00:00:00 2001 From: Nico Kadel-Garcia Date: Sun, 2 May 2021 23:11:45 -0400 Subject: [PATCH 04/11] Change file name of amazon-efs-utils.spec.in for test/global_test/test_global_version_match.py --- test/global_test/test_global_version_match.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/global_test/test_global_version_match.py b/test/global_test/test_global_version_match.py index 5fb86303..0e699b19 100644 --- a/test/global_test/test_global_version_match.py +++ b/test/global_test/test_global_version_match.py @@ -17,7 +17,7 @@ SPEC_FILE = 'amazon-efs-utils.spec' DEB_FILE = 'build-deb.sh' FILE_LIST = ['build-deb.sh', 'src/watchdog/__init__.py', 'src/mount_efs/__init__.py', - 'dist/amazon-efs-utils.control', 'build-deb.sh', 'amazon-efs-utils.spec'] + 'dist/amazon-efs-utils.control', 'build-deb.sh', 'amazon-efs-utils.spec.in'] GLOBAL_CONFIG = 'config.ini' From fa59150279e1df029239f199eed449c730fa5408 Mon Sep 17 00:00:00 2001 From: Nico Kadel-Garcia Date: Sun, 2 May 2021 23:39:21 -0400 Subject: [PATCH 05/11] Delete all $(PACKAGE_NAME)*/ directories with make clean --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8939da03..e00818bb 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ export PYTHONPATH := $(shell pwd)/src .PHONY: clean clean: rm -rf $(BUILD_DIR) - rm -rf $(PACKAGE_NAME) + rm -rf $(PACKAGE_NAME)*/ rm -f *.gz rm -f *.spec From fc626ebafa3b769ead752ba635c47b06fc87c630 Mon Sep 17 00:00:00 2001 From: Nico Kadel-Garcia Date: Mon, 3 May 2021 01:25:40 -0400 Subject: [PATCH 06/11] Set SPEC_FILE to amazon-efs-utils.spec.in in tests --- test/global_test/test_global_version_match.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/global_test/test_global_version_match.py b/test/global_test/test_global_version_match.py index 0e699b19..3917aa15 100644 --- a/test/global_test/test_global_version_match.py +++ b/test/global_test/test_global_version_match.py @@ -14,7 +14,7 @@ from configparser import ConfigParser -SPEC_FILE = 'amazon-efs-utils.spec' +SPEC_FILE = 'amazon-efs-utils.spec.in' DEB_FILE = 'build-deb.sh' FILE_LIST = ['build-deb.sh', 'src/watchdog/__init__.py', 'src/mount_efs/__init__.py', 'dist/amazon-efs-utils.control', 'build-deb.sh', 'amazon-efs-utils.spec.in'] From 8fedb4d651e42a18e6ce56705739b2badd8d399c Mon Sep 17 00:00:00 2001 From: Nico Kadel-Garcia Date: Mon, 3 May 2021 08:25:34 -0400 Subject: [PATCH 07/11] Clear dependency on amazon-efs-utils.spec.in to allow successful tests --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index e00818bb..95b9f387 100644 --- a/Makefile +++ b/Makefile @@ -43,8 +43,8 @@ tarball: clean sources: tarball .PHONLY: $(SPECFILE) -$(SPECFILE): $(SPECFILE).in - sed 's/^Version:.*/Version: $(VERSION)/g' $? > $@ +$(SPECFILE): + sed 's/^Version:.*/Version: $(VERSION)/g' $(SPECFILE).in > $@ .PHONY: rpm-only rpm-only:: $(TARBALL) From bd2a8870599a03a62337e9e8a792960c64862f40 Mon Sep 17 00:00:00 2001 From: Nico Kadel-Garcia Date: Mon, 3 May 2021 08:43:18 -0400 Subject: [PATCH 08/11] Add .cache/ to .gitignore. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index cf79e172..2792ec67 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ *\#* *~ .DS_Store +.cache/ .coverage .pytest_cache /*efs-utils*/ From b974cdef8ed25bee1c3ce02044d184c6fca1c875 Mon Sep 17 00:00:00 2001 From: Nico Kadel-Garcia Date: Mon, 3 May 2021 08:48:44 -0400 Subject: [PATCH 09/11] Put spec file back at amazon-efs-utils.spec, generate VERSION based specfile in dist/amazon-efs-utils.spec --- Makefile | 5 +++-- amazon-efs-utils.spec.in => amazon-efs-utils.spec | 0 test/global_test/test_global_version_match.py | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) rename amazon-efs-utils.spec.in => amazon-efs-utils.spec (100%) diff --git a/Makefile b/Makefile index 95b9f387..776cf48b 100644 --- a/Makefile +++ b/Makefile @@ -44,7 +44,8 @@ sources: tarball .PHONLY: $(SPECFILE) $(SPECFILE): - sed 's/^Version:.*/Version: $(VERSION)/g' $(SPECFILE).in > $@ + mkdir -p dist + sed 's/^Version:.*/Version: $(VERSION)/g' > dist/$(SPECFILE) > $@ .PHONY: rpm-only rpm-only:: $(TARBALL) @@ -53,7 +54,7 @@ rpm-only:: $(SPECFILE) rpmbuild -ba \ --define "_topdir `pwd`/$(BUILD_DIR)" \ --define '_sourcedir $(PWD)' \ - $(SPECFILE) + dist/$(SPECFILE) cp $(BUILD_DIR)/RPMS/*/*rpm build .PHONY: rpm diff --git a/amazon-efs-utils.spec.in b/amazon-efs-utils.spec similarity index 100% rename from amazon-efs-utils.spec.in rename to amazon-efs-utils.spec diff --git a/test/global_test/test_global_version_match.py b/test/global_test/test_global_version_match.py index 3917aa15..5fb86303 100644 --- a/test/global_test/test_global_version_match.py +++ b/test/global_test/test_global_version_match.py @@ -14,10 +14,10 @@ from configparser import ConfigParser -SPEC_FILE = 'amazon-efs-utils.spec.in' +SPEC_FILE = 'amazon-efs-utils.spec' DEB_FILE = 'build-deb.sh' FILE_LIST = ['build-deb.sh', 'src/watchdog/__init__.py', 'src/mount_efs/__init__.py', - 'dist/amazon-efs-utils.control', 'build-deb.sh', 'amazon-efs-utils.spec.in'] + 'dist/amazon-efs-utils.control', 'build-deb.sh', 'amazon-efs-utils.spec'] GLOBAL_CONFIG = 'config.ini' From 0c6c225b2099d1b22a7e1e981e527c4f6e75b6ea Mon Sep 17 00:00:00 2001 From: Nico Kadel-Garcia Date: Mon, 3 May 2021 08:52:28 -0400 Subject: [PATCH 10/11] More successfully use dist/*.spec to generate RPM compatible tarball and update Versions --- Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 776cf48b..d37d538f 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,6 @@ clean: rm -rf $(BUILD_DIR) rm -rf $(PACKAGE_NAME)*/ rm -f *.gz - rm -f *.spec .PHONY: tarball tarball: clean @@ -42,10 +41,10 @@ tarball: clean .PHONY: sources sources: tarball -.PHONLY: $(SPECFILE) +.PHONY: $(SPECFILE) $(SPECFILE): mkdir -p dist - sed 's/^Version:.*/Version: $(VERSION)/g' > dist/$(SPECFILE) > $@ + sed 's/^Version:.*/Version: $(VERSION)/g' $(SPECFILE) > dist/$(SPECFILE) .PHONY: rpm-only rpm-only:: $(TARBALL) From d1373bfa43a1072a464fe330958a867f7ef26f13 Mon Sep 17 00:00:00 2001 From: Nico Kadel-Garcia Date: Sun, 30 May 2021 11:37:12 -0400 Subject: [PATCH 11/11] Update Makefile to v1.31.1 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d37d538f..6406196e 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ # PACKAGE_NAME = amazon-efs-utils -VERSION = 1.30.2 +VERSION = 1.31.1 SOURCE_TARBALL = $(PACKAGE_NAME)-$(VERSION).tar.gz SPECFILE = $(PACKAGE_NAME).spec BUILD_DIR = build/rpmbuild