forked from timlau/yumex-dnf-old
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
160 lines (126 loc) · 5.19 KB
/
Makefile
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
APPNAME = yumex-dnf
DATADIR = /usr/share
PYTHON = python3
SUBDIRS = gfx misc po
VERSION=$(shell awk '/Version:/ { print $$2 }' ${APPNAME}.spec)
GITDATE=git$(shell date +%Y%m%d)
VER_REGEX=\(^Version:\s*[0-9]*\.[0-9]*\.\)\(.*\)
BUMPED_MINOR=${shell VN=`cat ${APPNAME}.spec | grep Version| sed 's/${VER_REGEX}/\2/'`; echo $$(($$VN + 1))}
NEW_VER=${shell cat ${APPNAME}.spec | grep Version| sed 's/\(^Version:\s*\)\([0-9]*\.[0-9]*\.\)\(.*\)/\2${BUMPED_MINOR}/'}
NEW_REL=0.1.${GITDATE}
DIST=${shell rpm --eval "%{dist}"}
GIT_MASTER=develop
CURDIR = ${shell pwd}
BUILDDIR= $(CURDIR)/build
all: build
$(SUBDIRS):
$(MAKE) -C $@
INSTALL_TARGETS = $(SUBDIRS:%=install-%)
$(INSTALL_TARGETS):
$(MAKE) -C $(@:install-%=%) install DESTDIR=$(DESTDIR) DATADIR=$(DATADIR)
CLEAN_TARGETS = $(SUBDIRS:%=clean-%)
$(CLEAN_TARGETS):
$(MAKE) -C $(@:clean-%=%) clean
build: $(SUBDIRS)
$(PYTHON) setup.py build
install: all $(INSTALL_TARGETS)
$(PYTHON) setup.py install --skip-build --root $(DESTDIR) --install-data=$(DATADIR)/$(APPNAME)
clean: $(CLEAN_TARGETS)
$(PYTHON) setup.py clean
-rm -f *.tar.gz
-rm -rf build
-rm -rf dist
get-builddeps:
@sudo dnf install python3-devel python3-gobject gettext intltool transifex-client
archive:
@rm -rf ${APPNAME}-${VERSION}.tar.gz
@git archive --format=tar --prefix=$(APPNAME)-$(VERSION)/ HEAD | gzip -9v >${APPNAME}-$(VERSION).tar.gz
@mkdir -p ${BUILDDIR}/SOURCES
@cp ${APPNAME}-$(VERSION).tar.gz ${BUILDDIR}/SOURCES
@rm -rf ${APPNAME}-${VERSION}.tar.gz
@echo "The archive is in ${BUILDDIR}/SOURCES/${APPNAME}-$(VERSION).tar.gz"
changelog:
$(PYTHON) tools/git2cl.py
upload:
@scp ~/rpmbuild/SOURCES/${APPNAME}-${VERSION}.tar.gz yum-extender.org:public_html/dnl/yumex/source/.
release-branch:
@git branch -m ${GIT_MASTER} release-${VERSION}
release-publish:
@git checkout release-${VERSION}
@git commit -a -m "bumped version to $(VERSION)"
@$(MAKE) changelog
@git commit -a -m "updated ChangeLog"
@git checkout release-devel
@git merge --no-ff release-${VERSION} -m "merge ${APPNAME}-${VERSION} release"
@git tag -f -m "Added ${APPNAME}-${VERSION} release tag" ${APPNAME}-${VERSION}
@git push --tags origin
@$(MAKE) archive
@$(MAKE) rpm
release-cleanup:
@git checkout develop
@git merge --no-ff release-${VERSION} -m "merge ${APPNAME}-${VERSION} release"
@git push origin
@git branch -D release-${VERSION}
test-cleanup:
@rm -rf ${APPNAME}-${VERSION}.test.tar.gz
@echo "Cleanup the git release-test local branch"
@git checkout -f
@git checkout ${GIT_MASTER}
@git branch -D release-test
show-vars:
@echo ${GITDATE}
@echo ${BUMPED_MINOR}
@echo ${NEW_VER}-${NEW_REL}
test-release:
@git checkout -b release-test
# +1 Minor version and add 0.1-gitYYYYMMDD release
@cat ${APPNAME}.spec | sed -e 's/${VER_REGEX}/\1${BUMPED_MINOR}/' -e 's/\(^Release:\s*\)\([0-9]*\)\(.*\)./\10.1.${GITDATE}%{?dist}/' > ${APPNAME}-test.spec ; mv ${APPNAME}-test.spec ${APPNAME}.spec
@git commit -a -m "bumped ${APPNAME} version ${NEW_VER}-${NEW_REL}"
# Make Changelog
$(PYTHON) tools/git2cl.py
@git commit -a -m "updated ChangeLog"
# Make archive
@rm -rf ${APPNAME}-${NEW_VER}.tar.gz
@git archive --format=tar --prefix=$(APPNAME)-$(NEW_VER)/ HEAD | gzip -9v >${APPNAME}-$(NEW_VER).tar.gz
# Build RPMS
@-rpmbuild --define '_topdir $(BUILDDIR)' -ta ${APPNAME}-${NEW_VER}.tar.gz
@$(MAKE) test-cleanup
rpm:
@$(MAKE) archive
@rpmbuild --define '_topdir $(BUILDDIR)' -ta ${BUILDDIR}/SOURCES/${APPNAME}-$(VERSION).tar.gz
test-builds:
@$(MAKE) test-release
@ssh timlau.fedorapeople.org rm public_html/files/yumex/*
@scp ${APPNAME}-${NEW_VER}.tar.gz timlau.fedorapeople.org:public_html/files/yumex/${APPNAME}-${NEW_VER}-${GITDATE}.tar.gz
@scp ~/rpmbuild/RPMS/noarch/${APPNAME}-${NEW_VER}*.rpm timlau.fedorapeople.org:public_html/files/yumex/.
@scp ~/rpmbuild/SRPMS/${APPNAME}-${NEW_VER}*.rpm timlau.fedorapeople.org:public_html/files/yumex/.
test-upd:
@$(MAKE) test-release
sudo dnf update ~/rpmbuild/RPMS/noarch/${APPNAME}-${NEW_VER}-${NEW_REL}*.rpm
test-inst:
@$(MAKE) test-release
sudo dnf install ~/rpmbuild/RPMS/noarch/${APPNAME}-${NEW_VER}-${NEW_REL}*.rpm
test-reinst:
@$(MAKE) test-release
sudo dnf reinstall ~/rpmbuild/RPMS/noarch/${APPNAME}-${NEW_VER}-${NEW_REL}*.rpm
transifex-setup:
tx init
tx set --auto-remote https://www.transifex.com/projects/p/yumex/
tx set --auto-local -r yumex.${APPNAME} 'po/<lang>.po' --source-lang en --source-file po/${APPNAME}.pot --execute
transifex-pull:
tx pull -a -f
@echo "You can now git commit -a -m 'Transfix pull, *.po update'"
transifex-push:
make -C po ${APPNAME}.pot
tx push -s
@echo "You can now git commit -a -m 'Transfix push, ${APPNAME}.pot update'"
status-exit:
/usr/bin/dbus-send --session --print-reply --dest=dk.yumex.StatusIcon / dk.yumex.StatusIcon.Exit
status-checkupdates:
/usr/bin/dbus-send --session --print-reply --dest=dk.yumex.StatusIcon / dk.yumex.StatusIcon.Start
/usr/bin/dbus-send --session --print-reply --dest=dk.yumex.StatusIcon / dk.yumex.StatusIcon.CheckUpdates
status-run:
cd dbus && ./dbus_status.py -v -d
.PHONY: all archive install clean build
.PHONY: $(SUBDIRS) $(INSTALL_TARGETS) $(CLEAN_TARGETS)
.PHONY: test-reinst test-inst mock-build rpm test-release test-cleanup show-vars release upload get-builddeps changelog