forked from timlau/yum-daemon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
192 lines (149 loc) · 6.97 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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
PKGNAME = yumdaemon
DATADIR=/usr/share
SYSCONFDIR=/etc
PKGDIR = $(DATADIR)/$(PKGNAME)
ORG_NAME = org.baseurl.YumSystem
ORG_RO_NAME = org.baseurl.YumSession
VERSION=$(shell awk '/Version:/ { print $$2 }' ${PKGNAME}.spec)
PYTHON=python
GITDATE=git$(shell date +%Y%m%d)
VER_REGEX=\(^Version:\s*[0-9]*\.[0-9]*\.\)\(.*\)
BUMPED_MINOR=${shell VN=`cat ${PKGNAME}.spec | grep Version| sed 's/${VER_REGEX}/\2/'`; echo $$(($$VN + 1))}
NEW_VER=${shell cat ${PKGNAME}.spec | grep Version| sed 's/\(^Version:\s*\)\([0-9]*\.[0-9]*\.\)\(.*\)/\2${BUMPED_MINOR}/'}
NEW_REL=0.1.${GITDATE}
DIST=${shell rpm --eval "%{dist}"}
all: subdirs
subdirs:
for d in $(SUBDIRS); do make -C $$d; [ $$? = 0 ] || exit 1 ; done
clean:
@rm -fv *~ *.tar.gz *.list *.lang
for d in $(SUBDIRS); do make -C $$d clean ; done
install:
mkdir -p $(DESTDIR)$(DATADIR)/dbus-1/system-services
mkdir -p $(DESTDIR)$(DATADIR)/dbus-1/services
mkdir -p $(DESTDIR)$(SYSCONFDIR)/dbus-1/system.d
mkdir -p $(DESTDIR)$(DATADIR)/polkit-1/actions
mkdir -p $(DESTDIR)$(PKGDIR)
install -m644 dbus/$(ORG_NAME).service $(DESTDIR)$(DATADIR)/dbus-1/system-services/.
install -m644 dbus/$(ORG_RO_NAME).service $(DESTDIR)$(DATADIR)/dbus-1/services/.
install -m644 dbus/$(ORG_NAME).conf $(DESTDIR)$(SYSCONFDIR)/dbus-1/system.d/.
install -m644 policykit1/$(ORG_NAME).policy $(DESTDIR)$(DATADIR)/polkit-1/actions/.
install -m755 yumdaemon/yumdaemon-system.py $(DESTDIR)/$(PKGDIR)/yumdaemon-system
install -m755 yumdaemon/yumdaemon-session.py $(DESTDIR)/$(PKGDIR)/yumdaemon-session
install -m644 yumdaemon/common.py $(DESTDIR)/$(PKGDIR)/.
for d in $(SUBDIRS); do make DESTDIR=$(DESTDIR) -C $$d install; [ $$? = 0 ] || exit 1; done
uninstall:
rm -f $(DESTDIR)$(DATADIR)/dbus-1/system-services/$(ORG_NAME).*
rm -f $(DESTDIR)$(DATADIR)/dbus-1/services/$(ORG_RO_NAME).*
rm -f $(DESTDIR)$(SYSCONFDIR)/dbus-1/system.d/$(ORG_NAME).*
rm -r $(DESTDIR)$(DATADIR)/polkit-1/actions/$(ORG_NAME).*
rm -rf $(DESTDIR)/$(PKGDIR)/
selinux:
@$(MAKE) install
semanage fcontext -a -t rpm_exec_t $(DESTDIR)/$(PKGDIR)/yumdaemon-system
restorecon $(DESTDIR)/$(PKGDIR)/yumdaemon-system
# Run as root or you will get a password prompt for each test method :)
test-verbose: FORCE
@nosetests -v -s test/
# Run as root or you will get a password prompt for each test method :)
test: FORCE
@nosetests -v test/
# Run as root or you will get a password prompt for each test method :)
test-system: FORCE
@nosetests -v test/test-system-api.py
# Run as root or you will get a password prompt for each test method :)
test-session: FORCE
@nosetests -v test/test-session-api.py
# Run as root or you will get a password prompt for each test method :)
test-devel: FORCE
@nosetests -v -s test/unit-devel.py
instdeps:
sudo yum install python-nose python3-gobject pygobject3
get-builddeps:
yum install perl-TimeDate gettext intltool rpmdevtools python-devel python3-devel
archive:
@rm -rf ${PKGNAME}-${VERSION}.tar.gz
@git archive --format=tar --prefix=$(PKGNAME)-$(VERSION)/ HEAD | gzip -9v >${PKGNAME}-$(VERSION).tar.gz
@cp ${PKGNAME}-$(VERSION).tar.gz $(shell rpm -E '%_sourcedir')
@rm -rf ${PKGNAME}-${VERSION}.tar.gz
@echo "The archive is in ${PKGNAME}-$(VERSION).tar.gz"
# needs perl-TimeDate for git2cl
changelog:
@git log --pretty --numstat --summary --after=2008-10-22 | tools/git2cl > ChangeLog
upload: FORCE
@scp ~/rpmbuild/SOURCES/${PKGNAME}-${VERSION}.tar.gz fedorahosted.org:yumex
release:
@git commit -a -m "bumped version to $(VERSION)"
@git push
@git tag -f -m "Added ${PKGNAME}-${VERSION} release tag" ${PKGNAME}-${VERSION}
@git push --tags origin
@$(MAKE) archive
@$(MAKE) upload
test-cleanup:
@rm -rf ${PKGNAME}-${VERSION}.test.tar.gz
@echo "Cleanup the git release-test local branch"
@git checkout -f
@git checkout 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 Minors version and add 0.1-gitYYYYMMDD release
@cat ${PKGNAME}.spec | sed -e 's/${VER_REGEX}/\1${BUMPED_MINOR}/' -e 's/\(^Release:\s*\)\([0-9]*\)\(.*\)./\10.1.${GITDATE}%{?dist}/' > ${PKGNAME}-test.spec ; mv ${PKGNAME}-test.spec ${PKGNAME}.spec
@git commit -a -m "bumped ${PKGNAME} version ${NEW_VER}-${NEW_REL}"
# Make Changelog
@git log --pretty --numstat --summary | ./tools/git2cl > ChangeLog
@git commit -a -m "updated ChangeLog"
# Make archive
@rm -rf ${PKGNAME}-${NEW_VER}.tar.gz
@git archive --format=tar --prefix=$(PKGNAME)-$(NEW_VER)/ HEAD | gzip -9v >${PKGNAME}-$(NEW_VER).tar.gz
# Build RPMS
@rpmbuild -ta ${PKGNAME}-${NEW_VER}.tar.gz
@$(MAKE) test-cleanup
test-inst:
@$(MAKE) test-release
sudo yum install ~/rpmbuild/RPMS/noarch/*${PKGNAME}-${NEW_VER}*.rpm
test-reinst:
@$(MAKE) test-release
sudo yum reinstall ~/rpmbuild/RPMS/noarch/*${PKGNAME}-${NEW_VER}*.rpm
rpm:
@$(MAKE) archive
@rpmbuild -ba ${PKGNAME}.spec
test-builds:
@$(MAKE) test-release
@ssh timlau.fedorapeople.org rm -f public_html/files/${PKGNAME}/*
@scp ${PKGNAME}-${NEW_VER}.tar.gz timlau.fedorapeople.org:public_html/files/${PKGNAME}/${PKGNAME}-${NEW_VER}-${GITDATE}.tar.gz
@scp ~/rpmbuild/RPMS/noarch/${PKGNAME}-${NEW_VER}*.rpm timlau.fedorapeople.org:public_html/files/${PKGNAME}/.
@scp ~/rpmbuild/RPMS/noarch/python-${PKGNAME}-${NEW_VER}*.rpm timlau.fedorapeople.org:public_html/files/${PKGNAME}/.
@scp ~/rpmbuild/RPMS/noarch/python3-${PKGNAME}-${NEW_VER}*.rpm timlau.fedorapeople.org:public_html/files/${PKGNAME}/.
@scp ~/rpmbuild/SRPMS/${PKGNAME}-${NEW_VER}*.rpm timlau.fedorapeople.org:public_html/files/${PKGNAME}/.
review:
@ssh timlau.fedorapeople.org rm -f public_html/files/${PKGNAME}/*
@scp ~/rpmbuild/SRPMS/${PKGNAME}-${VERSION}*.src.rpm timlau.fedorapeople.org:public_html/files/${PKGNAME}/.
@scp ${PKGNAME}.spec timlau.fedorapeople.org:public_html/files/${PKGNAME}/.
mock-build:
@$(MAKE) test-release
@tools/repo-build.py --build ${PKGNAME} ~/rpmbuild/SRPMS/${PKGNAME}-${NEW_VER}-${NEW_REL}${DIST}.src.rpm
@tools/repo-build.py --copy ${PKGNAME} ~/rpmbuild/SRPMS/${PKGNAME}-${NEW_VER}-${NEW_REL}${DIST}.src.rpm
kill-session:
@/usr/bin/dbus-send --session --print-reply --dest="org.baseurl.YumSession" / org.baseurl.YumSession.Exit
kill-system:
@sudo /usr/bin/dbus-send --system --print-reply --dest="org.baseurl.YumSystem" / org.baseurl.YumSystem.Exit
kill-both:
@/usr/bin/dbus-send --session --print-reply --dest="org.baseurl.YumSession" / org.baseurl.YumSession.Exit
@sudo /usr/bin/dbus-send --system --print-reply --dest="org.baseurl.YumSystem" / org.baseurl.YumSystem.Exit
start-session:
yumdaemon/yumdaemon-session.py -d -v --notimeout
start-system:
sudo yumdaemon/yumdaemon-system.py -d -v --notimeout
kill:
@-sudo killall -9 -r "yumdaemon-system\.py" &> /dev/null
@-sudo killall -9 -r "yumdaemon-session\.py" &> /dev/null
monitor-yum-session:
dbus-monitor "type='signal',sender='org.baseurl.YumSession',interface='org.baseurl.YumSession'"
monitor-yum-system:
dbus-monitor "type='signal',sender='org.baseurl.YumSystem',interface='org.baseurl.YumSystem'"
FORCE: