-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.maint
45 lines (34 loc) · 1.49 KB
/
Makefile.maint
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# -*- makefile -*-
# Targets useful for maintenance/making releases etc. Some of them depend
# on very specific local setups
include Makefile
rpmbuild_dir=/data/rpmbuild/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
rpb_spec=$(rpmbuild_dir)/netcf.spec
rel_dir=fedorahosted.org:netcf
tarball=$(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz
# For Release: 0..., set _ovirt_dev=1 so that we get extra_release.GIT-
# annotated rpm version strings.
_netcf_dev = \
$(shell grep -q '^[[:space:]]*Release:[[:space:]]*0' \
$(srcdir)/*.spec.in && echo 1 || :)
git_head = $$(git log -1 --pretty=format:%h)
git_release = $$(date --utc +%Y%m%d%H%M%S)git$(git_head)
rpm_flags += $(if $(_netcf_dev),--define "extra_release .$(git_release)")
# This only works with the way I have set up my .rpmmacros
build-rpm:
test -d $(rpmbuild_dir) || mkdir $(rpmbuild_dir)
rm -f $(rpmbuild_dir)/$(tarball) $(rpb_spec) $(rpmbuild_dir)/*.rpm
ln -sf $(abs_top_srcdir)/$(tarball) $(rpmbuild_dir)
ln -sf $(abs_top_srcdir)/netcf.spec $(rpmbuild_dir)
rpmbuild $(rpm_flags) -ba $(rpmbuild_dir)/netcf.spec
upload:
@gpg -q --batch --verify $(tarball).sig > /dev/null 2>&1 || \
gpg --output $(tarball).sig --detach-sig $(tarball); \
scp $(tarball) $(tarball).sig $(rel_dir); \
git push origin tag release-$(VERSION)
tag-release:
@git tag -s release-$(VERSION)
# This is how I run autogen locally. YMMV
autogen:
./autogen.sh --prefix=/data/share --gnulib-srcdir=${HOME}/code/gnulib/ --enable-compile-warnings=error
.PHONY: build-rpm