Move spec file into packaging/
This is cleaner once projects add debian and arch packaging. Factorize the spec name/path in the Makefile.
This commit is contained in:
parent
0493621504
commit
799d8f5cc9
2 changed files with 11 additions and 10 deletions
21
Makefile
21
Makefile
|
|
@ -8,7 +8,8 @@ endif
|
||||||
export TEST_OS
|
export TEST_OS
|
||||||
TARFILE=$(RPM_NAME)-$(VERSION).tar.xz
|
TARFILE=$(RPM_NAME)-$(VERSION).tar.xz
|
||||||
NODE_CACHE=$(RPM_NAME)-node-$(VERSION).tar.xz
|
NODE_CACHE=$(RPM_NAME)-node-$(VERSION).tar.xz
|
||||||
RPMFILE=$(shell rpmspec -D"VERSION $(VERSION)" -q $(RPM_NAME).spec.in).rpm
|
SPEC=$(RPM_NAME).spec
|
||||||
|
RPMFILE=$(shell rpmspec -D"VERSION $(VERSION)" -q packaging/$(SPEC).in).rpm
|
||||||
VM_IMAGE=$(CURDIR)/test/images/$(TEST_OS)
|
VM_IMAGE=$(CURDIR)/test/images/$(TEST_OS)
|
||||||
# stamp file to check if/when npm install ran
|
# stamp file to check if/when npm install ran
|
||||||
NODE_MODULES_TEST=package-lock.json
|
NODE_MODULES_TEST=package-lock.json
|
||||||
|
|
@ -53,7 +54,7 @@ update-po: po/$(PACKAGE_NAME).pot
|
||||||
# Build/Install/dist
|
# Build/Install/dist
|
||||||
#
|
#
|
||||||
|
|
||||||
%.spec: %.spec.in
|
%.spec: packaging/%.spec.in
|
||||||
sed -e 's/%{VERSION}/$(VERSION)/g' $< > $@
|
sed -e 's/%{VERSION}/$(VERSION)/g' $< > $@
|
||||||
|
|
||||||
$(WEBPACK_TEST): $(NODE_MODULES_TEST) $(LIB_TEST) $(shell find src/ -type f) package.json webpack.config.js
|
$(WEBPACK_TEST): $(NODE_MODULES_TEST) $(LIB_TEST) $(shell find src/ -type f) package.json webpack.config.js
|
||||||
|
|
@ -64,7 +65,7 @@ watch:
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf dist/
|
rm -rf dist/
|
||||||
rm -f $(RPM_NAME).spec
|
rm -f $(SPEC)
|
||||||
|
|
||||||
install: $(WEBPACK_TEST)
|
install: $(WEBPACK_TEST)
|
||||||
mkdir -p $(DESTDIR)/usr/share/cockpit/$(PACKAGE_NAME)
|
mkdir -p $(DESTDIR)/usr/share/cockpit/$(PACKAGE_NAME)
|
||||||
|
|
@ -88,28 +89,28 @@ dist: $(TARFILE)
|
||||||
# pre-built dist/ (so it's not necessary) and ship packge-lock.json (so that
|
# pre-built dist/ (so it's not necessary) and ship packge-lock.json (so that
|
||||||
# node_modules/ can be reconstructed if necessary)
|
# node_modules/ can be reconstructed if necessary)
|
||||||
$(TARFILE): export NODE_ENV=production
|
$(TARFILE): export NODE_ENV=production
|
||||||
$(TARFILE): $(WEBPACK_TEST) $(RPM_NAME).spec
|
$(TARFILE): $(WEBPACK_TEST) $(SPEC)
|
||||||
if type appstream-util >/dev/null 2>&1; then appstream-util validate-relax --nonet *.metainfo.xml; fi
|
if type appstream-util >/dev/null 2>&1; then appstream-util validate-relax --nonet *.metainfo.xml; fi
|
||||||
touch -r package.json $(NODE_MODULES_TEST)
|
touch -r package.json $(NODE_MODULES_TEST)
|
||||||
touch dist/*
|
touch dist/*
|
||||||
tar --xz -cf $(TARFILE) --transform 's,^,$(RPM_NAME)/,' \
|
tar --xz -cf $(TARFILE) --transform 's,^,$(RPM_NAME)/,' \
|
||||||
--exclude $(RPM_NAME).spec.in --exclude node_modules \
|
--exclude packaging/$(SPEC).in --exclude node_modules \
|
||||||
$$(git ls-files) src/lib package-lock.json $(RPM_NAME).spec dist/
|
$$(git ls-files) src/lib package-lock.json $(SPEC) dist/
|
||||||
|
|
||||||
$(NODE_CACHE): $(NODE_MODULES_TEST)
|
$(NODE_CACHE): $(NODE_MODULES_TEST)
|
||||||
tar --xz -cf $@ node_modules
|
tar --xz -cf $@ node_modules
|
||||||
|
|
||||||
node-cache: $(NODE_CACHE)
|
node-cache: $(NODE_CACHE)
|
||||||
|
|
||||||
srpm: $(TARFILE) $(NODE_CACHE) $(RPM_NAME).spec
|
srpm: $(TARFILE) $(NODE_CACHE) $(SPEC)
|
||||||
rpmbuild -bs \
|
rpmbuild -bs \
|
||||||
--define "_sourcedir `pwd`" \
|
--define "_sourcedir `pwd`" \
|
||||||
--define "_srcrpmdir `pwd`" \
|
--define "_srcrpmdir `pwd`" \
|
||||||
$(RPM_NAME).spec
|
$(SPEC)
|
||||||
|
|
||||||
rpm: $(RPMFILE)
|
rpm: $(RPMFILE)
|
||||||
|
|
||||||
$(RPMFILE): $(TARFILE) $(NODE_CACHE) $(RPM_NAME).spec
|
$(RPMFILE): $(TARFILE) $(NODE_CACHE) $(SPEC)
|
||||||
mkdir -p "`pwd`/output"
|
mkdir -p "`pwd`/output"
|
||||||
mkdir -p "`pwd`/rpmbuild"
|
mkdir -p "`pwd`/rpmbuild"
|
||||||
rpmbuild -bb \
|
rpmbuild -bb \
|
||||||
|
|
@ -119,7 +120,7 @@ $(RPMFILE): $(TARFILE) $(NODE_CACHE) $(RPM_NAME).spec
|
||||||
--define "_srcrpmdir `pwd`" \
|
--define "_srcrpmdir `pwd`" \
|
||||||
--define "_rpmdir `pwd`/output" \
|
--define "_rpmdir `pwd`/output" \
|
||||||
--define "_buildrootdir `pwd`/build" \
|
--define "_buildrootdir `pwd`/build" \
|
||||||
$(RPM_NAME).spec
|
$(SPEC)
|
||||||
find `pwd`/output -name '*.rpm' -printf '%f\n' -exec mv {} . \;
|
find `pwd`/output -name '*.rpm' -printf '%f\n' -exec mv {} . \;
|
||||||
rm -r "`pwd`/rpmbuild"
|
rm -r "`pwd`/rpmbuild"
|
||||||
rm -r "`pwd`/output" "`pwd`/build"
|
rm -r "`pwd`/output" "`pwd`/build"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue