-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
216 lines (201 loc) · 10.2 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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
NAME = smt
VERSION = 3.0.50
DESTDIR = /
PERL ?= perl
PERLMODDIR = $(shell $(PERL) -MConfig -e 'print $$Config{installvendorlib};')
TEMPF = $(shell mktemp)
DOCDIR = /usr/share/doc/packages
all:
make -C swig
install_all: install install_conf
install_conf:
mkdir -p $(DESTDIR)/etc/
install -m 640 config/smt.conf $(DESTDIR)/etc/
mkdir -p $(DESTDIR)/etc/init.d/
install:
mkdir -p $(DESTDIR)/usr/sbin/
mkdir -p $(DESTDIR)/usr/bin/
mkdir -p $(DESTDIR)/etc/apache2/conf.d
mkdir -p $(DESTDIR)/etc/apache2/vhosts.d
mkdir -p $(DESTDIR)/etc/cron.d/
mkdir -p $(DESTDIR)/etc/smt.d/
mkdir -p $(DESTDIR)/etc/logrotate.d/
mkdir -p $(DESTDIR)/etc/slp.reg.d/
mkdir -p $(DESTDIR)/srv/www/htdocs/repo/tools
mkdir -p $(DESTDIR)/srv/www/htdocs/repo/keys
mkdir -p $(DESTDIR)/srv/www/htdocs/repo/testing
mkdir -p $(DESTDIR)/srv/www/htdocs/repo/full
mkdir -p $(DESTDIR)/srv/www/perl-lib/NU
mkdir -p $(DESTDIR)/srv/www/perl-lib/SMT
mkdir -p $(DESTDIR)/srv/www/perl-lib/SMT/Client
mkdir -p $(DESTDIR)$(PERLMODDIR)/SMT/Mirror
mkdir -p $(DESTDIR)$(PERLMODDIR)/SMT/Parser
mkdir -p $(DESTDIR)$(PERLMODDIR)/SMT/Utils
mkdir -p $(DESTDIR)$(PERLMODDIR)/SMT/Job
mkdir -p $(DESTDIR)$(PERLMODDIR)/SMT/Rest
mkdir -p $(DESTDIR)/usr/share/schemas/smt
mkdir -p $(DESTDIR)/usr/share/schemas/smt/mysql
mkdir -p $(DESTDIR)/usr/share/schemas/smt/_common
mkdir -p $(DESTDIR)/usr/lib/SMT/bin/
mkdir -p $(DESTDIR)/usr/lib/systemd/system/
mkdir -p $(DESTDIR)$(DOCDIR)/smt
install -m 644 apache2/smt-mod_perl-startup.pl $(DESTDIR)/etc/apache2/
install -m 644 apache2/conf.d/*.conf $(DESTDIR)/etc/apache2/conf.d/
install -m 644 apache2/vhosts.d/*.conf $(DESTDIR)/etc/apache2/vhosts.d/
install -m 755 script/smt $(DESTDIR)/usr/sbin/
install -m 755 script/smt-* $(DESTDIR)/usr/sbin/
if [ -e $(DESTDIR)/usr/sbin/smt-catalogs ]; then rm -f $(DESTDIR)/usr/sbin/smt-catalogs; fi
if [ -e $(DESTDIR)/usr/sbin/smt-setup-custom-catalogs ]; then rm -f $(DESTDIR)/usr/sbin/smt-setup-custom-catalogs; fi
ln -s smt-repos $(DESTDIR)/usr/sbin/smt-catalogs
ln -s smt-setup-custom-repos $(DESTDIR)/usr/sbin/smt-setup-custom-catalogs
install -m 644 www/perl-lib/NU/*.pm $(DESTDIR)/srv/www/perl-lib/NU/
install -m 644 www/perl-lib/SMT/Registration.pm $(DESTDIR)/srv/www/perl-lib/SMT/
install -m 644 www/perl-lib/SMT/RegistrationSharing.pm $(DESTDIR)$(PERLMODDIR)/SMT/
install -m 644 www/perl-lib/SMT/Support.pm $(DESTDIR)/srv/www/perl-lib/SMT/
install -m 644 www/perl-lib/SMT/Utils.pm $(DESTDIR)$(PERLMODDIR)/SMT/
install -m 644 www/perl-lib/SMT/Mirror/*.pm /$(DESTDIR)$(PERLMODDIR)/SMT/Mirror/
install -m 644 www/perl-lib/SMT/Parser/*.pm /$(DESTDIR)$(PERLMODDIR)/SMT/Parser/
install -m 644 www/perl-lib/SMT/Client/*.pm /$(DESTDIR)/srv/www/perl-lib/SMT/Client/
install -m 644 www/perl-lib/SMT/CLI.pm /$(DESTDIR)$(PERLMODDIR)/SMT/
install -m 644 www/perl-lib/SMT/Curl.pm /$(DESTDIR)$(PERLMODDIR)/SMT/
install -m 644 www/perl-lib/SMT.pm $(DESTDIR)$(PERLMODDIR)
install -m 644 www/perl-lib/SMT/Filter.pm $(DESTDIR)$(PERLMODDIR)/SMT/
install -m 644 www/perl-lib/SMT/Repositories.pm $(DESTDIR)$(PERLMODDIR)/SMT/
install -m 644 www/perl-lib/SMT/JobQueue.pm $(DESTDIR)$(PERLMODDIR)/SMT/
install -m 644 www/perl-lib/SMT/Job.pm $(DESTDIR)$(PERLMODDIR)/SMT/
install -m 644 www/perl-lib/SMT/Client.pm $(DESTDIR)$(PERLMODDIR)/SMT/
install -m 644 www/perl-lib/SMT/Package.pm $(DESTDIR)$(PERLMODDIR)/SMT/
install -m 644 www/perl-lib/SMT/Patch.pm $(DESTDIR)$(PERLMODDIR)/SMT/
install -m 644 www/perl-lib/SMT/PatchRef.pm $(DESTDIR)$(PERLMODDIR)/SMT/
install -m 644 www/perl-lib/SMT/Product.pm $(DESTDIR)$(PERLMODDIR)/SMT/
install -m 644 www/perl-lib/SMT/SCC*.pm $(DESTDIR)$(PERLMODDIR)/SMT/
install -m 644 www/perl-lib/SMT/RESTService.pm $(DESTDIR)/srv/www/perl-lib/SMT/
install -m 644 www/perl-lib/SMT/RESTInfo.pm $(DESTDIR)/srv/www/perl-lib/SMT/
install -m 644 www/perl-lib/SMT/Rest/*.pm $(DESTDIR)$(PERLMODDIR)/SMT/Rest/
install -m 644 www/perl-lib/SMT/ConnectAPI.pm $(DESTDIR)/srv/www/perl-lib/SMT/
install -m 644 www/perl-lib/SMT/Error.pm $(DESTDIR)/srv/www/perl-lib/SMT/
install -m 644 www/perl-lib/SMT/Utils/*.pm $(DESTDIR)$(PERLMODDIR)/SMT/Utils/
install -m 644 www/perl-lib/SMT/Job/*.pm $(DESTDIR)$(PERLMODDIR)/SMT/Job/
cd db/schemas; \
find mysql/ \
-type d -exec install -m755 -d $(DESTDIR)/usr/share/schemas/smt/\{\} \; \
-o \
\( -type f -exec install -m644 \{\} $(DESTDIR)/usr/share/schemas/smt/\{\} \; \)
install -m 444 config/smt.target $(DESTDIR)/usr/lib/systemd/system/
install -m 444 config/smt.service $(DESTDIR)/usr/lib/systemd/system/
install -m 444 config/smt-schema-upgrade.service $(DESTDIR)/usr/lib/systemd/system/
install -m 755 config/smt-maintenance $(DESTDIR)/usr/lib/SMT/bin/
install -D -m 644 config/tmpfile-smt.conf $(DESTDIR)/usr/lib/tmpfiles.d/smt.conf
install -m 655 config/smt.reg $(DESTDIR)/etc/slp.reg.d/
install -m 755 db/smt-db $(DESTDIR)/usr/lib/SMT/bin/
install -m 755 db/smt-sql $(DESTDIR)/usr/bin/
install -m 755 db/smt-schema-upgrade $(DESTDIR)/usr/bin/
install -m 755 script/changeSMTUserPermissions.sh $(DESTDIR)/usr/lib/SMT/bin/
install -m 755 script/reschedule-sync.sh $(DESTDIR)/usr/lib/SMT/bin/
install -m 755 tests/SMT/shareRegistration.pl $(DESTDIR)/usr/lib/SMT/bin/
install -m 755 script/clientSetup4SMT.sh $(DESTDIR)/srv/www/htdocs/repo/tools/
install -m 644 www/repo/res-signingkeys.key $(DESTDIR)/srv/www/htdocs/repo/keys/
install -m 644 cron/novell.com-smt $(DESTDIR)/etc/cron.d/
install -m 644 cron/smt-cron.conf $(DESTDIR)/etc/smt.d/
install -m 755 cron/smt-daily $(DESTDIR)/usr/lib/SMT/bin/
install -m 755 cron/smt-run-jobqueue-cleanup $(DESTDIR)/usr/lib/SMT/bin/
install -m 755 cron/smt-jobqueue-cleanup $(DESTDIR)/usr/lib/SMT/bin/
install -m 755 cron/smt-gen-report $(DESTDIR)/usr/lib/SMT/bin/
install -m 755 cron/smt-repeated-register $(DESTDIR)/usr/lib/SMT/bin/
install -m 644 logrotate/smt $(DESTDIR)/etc/logrotate.d/
install -m 644 README $(DESTDIR)$(DOCDIR)/smt/
install -m 644 COPYING $(DESTDIR)$(DOCDIR)/smt/
install -m 644 doc/High-Level-Architecture.odp $(DESTDIR)$(DOCDIR)/smt/
install -m 644 doc/Registrationdata-NCC-YEP.odt $(DESTDIR)$(DOCDIR)/smt/
install -m 644 doc/SMT-Database-Schema.odg $(DESTDIR)$(DOCDIR)/smt/
install -m 644 doc/NCC-Client-Registration-via-YEP.odt $(DESTDIR)$(DOCDIR)/smt/
install -m 644 doc/Server-Tuning.txt $(DESTDIR)$(DOCDIR)/smt/
install -m 644 doc/SMT-Database-Schema.txt $(DESTDIR)$(DOCDIR)/smt/
install -m 644 doc/SMT-REST-API.txt $(DESTDIR)$(DOCDIR)/smt/
install -m 644 doc/README-SCC $(DESTDIR)$(DOCDIR)/smt/
make -C swig $@
mkdir -p $(DESTDIR)/var/spool/smt-support
chown smt:www $(DESTDIR)/var/spool/smt-support || echo "Set ownership manually: chown smt:www $(DESTDIR)/var/spool/smt-support"
chmod 775 $(DESTDIR)/var/spool/smt-support || echo "Set permission manually: chmod 775 $(DESTDIR)/var/spool/smt-support"
test: clean
cd tests; perl tests.pl && cd -
clean:
find . -name "*~" -print0 | xargs -0 rm -f
rm -rf $(NAME)-*/
rm -f $(NAME)-*.tar.bz2
rm -f package/$(NAME)-*.tar.bz2
make -C swig $@
maintainer-clean: clean
make -C yast maintainer-clean
rm -f yast/*.ami
rm -f yast/configure yast/configure.in
find yast/ -name "Makefile.in" -print0 | xargs -0 rm -f
rm -f yast/config.guess
rm -f yast/config.sub
rm -f yast/Makefile.am*
rm -f yast/missing
rm -f yast/aclocal.m4
rm -f yast/install-sh
dist: clean
rm -rf $(NAME)-$(VERSION)/
@mkdir -p $(NAME)-$(VERSION)/apache2/conf.d/
@mkdir -p $(NAME)-$(VERSION)/apache2/vhosts.d/
@mkdir -p $(NAME)-$(VERSION)/config
@mkdir -p $(NAME)-$(VERSION)/cron
@mkdir -p $(NAME)-$(VERSION)/db
@mkdir -p $(NAME)-$(VERSION)/doc
@mkdir -p $(NAME)-$(VERSION)/script
@mkdir -p $(NAME)-$(VERSION)/tests/SMT/Mirror
@mkdir -p $(NAME)-$(VERSION)/tests/testdata/jobtest
@mkdir -p $(NAME)-$(VERSION)/tests/testdata/rpmmdtest
@mkdir -p $(NAME)-$(VERSION)/tests/testdata/regdatatest
@mkdir -p $(NAME)-$(VERSION)/www
@mkdir -p $(NAME)-$(VERSION)/logrotate
@cp apache2/*.pl $(NAME)-$(VERSION)/apache2/
@cp apache2/conf.d/*.conf $(NAME)-$(VERSION)/apache2/conf.d/
@cp apache2/vhosts.d/*.conf $(NAME)-$(VERSION)/apache2/vhosts.d/
@cp config/smt.conf.production $(NAME)-$(VERSION)/config/smt.conf
@cp config/smt.target $(NAME)-$(VERSION)/config/
@cp config/smt.service $(NAME)-$(VERSION)/config/
@cp config/smt-schema-upgrade.service $(NAME)-$(VERSION)/config/
@cp config/smt-maintenance $(NAME)-$(VERSION)/config/
@cp config/tmpfile-smt.conf $(NAME)-$(VERSION)/config/
@cp config/smt.reg $(NAME)-$(VERSION)/config/
@cp cron/smt-* $(NAME)-$(VERSION)/cron/
@cp cron/novell.com-smt $(NAME)-$(VERSION)/cron/
find db -name ".svn" -prune -o \
\( \
\( -type d -exec install -m755 -d $(NAME)-$(VERSION)/\{\} \; \) \
-o \
\( -type f -exec install -m644 \{\} $(NAME)-$(VERSION)/\{\} \; \) \
\)
@cp doc/High-Level-Architecture.odp $(NAME)-$(VERSION)/doc/
@cp doc/NCC-Client-Registration-via-YEP.odt $(NAME)-$(VERSION)/doc/
@cp doc/Registrationdata-NCC-YEP.odt $(NAME)-$(VERSION)/doc/
@cp doc/Server-Tuning.txt $(NAME)-$(VERSION)/doc/
@cp doc/SMT-Database-Schema.odg $(NAME)-$(VERSION)/doc/
@cp doc/SMT-Database-Schema.txt $(NAME)-$(VERSION)/doc/
@cp doc/SMT-REST-API.txt $(NAME)-$(VERSION)/doc/
@cp doc/README-SCC $(NAME)-$(VERSION)/doc/
@cp tests/*.pl $(NAME)-$(VERSION)/tests/
@cp tests/SMT/shareRegistration.pl $(NAME)-$(VERSION)/tests/SMT
@cp tests/SMT/Mirror/*.pl $(NAME)-$(VERSION)/tests/SMT/Mirror/
@cp -r tests/testdata/regdatatest/* $(NAME)-$(VERSION)/tests/testdata/regdatatest/
@cp script/* $(NAME)-$(VERSION)/script/
@cp logrotate/smt $(NAME)-$(VERSION)/logrotate/
find www -name ".svn" -prune -o \
\( \
\( -type d -exec install -m755 -d $(NAME)-$(VERSION)/\{\} \; \) \
-o \
\( -type f -exec install -m644 \{\} $(NAME)-$(VERSION)/\{\} \; \) \
\)
make -C swig NAME=$(NAME) VERSION=$(VERSION) $@
@cp Makefile README COPYING $(NAME)-$(VERSION)/
tar cfvj $(NAME)-$(VERSION).tar.bz2 $(NAME)-$(VERSION)/
pot:
find www/ -name "*.pm" > sourcefiles
find script/ -maxdepth 1 -name "smt*" >> sourcefiles
xgettext --default-domain=smt --directory=. --keyword=__ -o smt.pot --files-from sourcefiles
rm -f sourcefiles
package: dist
mv $(NAME)-$(VERSION).tar.bz2 package/