Skip to content

Commit 058944f

Browse files
author
Alejandro Alvarez Ayllon
committed
FTS-248: Normalizing rpm Makefiles
1 parent ba1e7fa commit 058944f

File tree

10 files changed

+107
-86
lines changed

10 files changed

+107
-86
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
.project
33
.settings
44
*.rpm
5+
*.tar.gz
6+

packaging/Makefile

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
NAME=fts
2+
SPEC=rpm/$(NAME).spec
3+
VERSION=${shell grep '^Version:' $(SPEC) | awk '{print $$2}' }
4+
5+
CWD=${shell pwd}
6+
7+
RPMBUILD=/tmp/rpmbuild
8+
SRPMS=$(CWD)
9+
RPMS=$(CWD)/out
10+
11+
MOCK_CHROOT=epel-6-cernonly-x86_64
12+
MOCK_FLAGS=--verbose
13+
14+
15+
RPMDEFINES_SRC=--define='_topdir $(RPMBUILD)' \
16+
--define='_sourcedir $(CWD)' \
17+
--define='_builddir %{_topdir}/BUILD' \
18+
--define='_srcrpmdir $(SRPMS)' \
19+
--define='_rpmdir $(RPMS)'
20+
21+
RPMDEFINES_BIN=--define='_topdir $(RPMBUILD)' \
22+
--define='_sourcedir %{_topdir}/SOURCES' \
23+
--define='_builddir %{_topdir}/BUILD' \
24+
--define='_srcrpmdir $(SRPMS).' \
25+
--define='_rpmdir $(RPMS)'
26+
27+
28+
all: srpm
29+
30+
clean:
31+
rm -fv *.tar.gz
32+
rm -fv *.rpm
33+
rm -fv *.log
34+
rm -rfv out
35+
rm -rfv "$(RPMBUILD)"
36+
37+
dist: clean
38+
tar vczf "$(NAME)-$(VERSION).tar.gz" --exclude="packaging" --exclude=".git" --exclude="*.pyc" --transform="s,^,$(NAME)-$(VERSION)/," ..
39+
40+
$(RPMBUILD):
41+
mkdir -p "$(RPMBUILD)"
42+
43+
srpm: dist $(SPEC) $(RPMBUILD)
44+
/usr/bin/rpmbuild --nodeps -bs $(RPMDEFINES_SRC) $(SPEC)
45+
46+
rpm: srpm
47+
/usr/bin/rpmbuild --rebuild $(RPMDEFINES_BIN) $(NAME)-$(VERSION)-*.src.rpm
48+
49+
mock: srpm
50+
/usr/bin/mock $(MOCK_FLAGS) -r $(MOCK_CHROOT) $(NAME)-$(VERSION)-*.src.rpm

packaging/Makefile_client

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
NAME=fts-client
2+
SPEC=rpm/$(NAME).spec
3+
VERSION=${shell grep '^Version:' $(SPEC) | awk '{print $$2}' }
4+
5+
CWD=${shell pwd}
6+
7+
RPMBUILD=/tmp/rpmbuild
8+
SRPMS=$(CWD)
9+
RPMS=$(CWD)/out
10+
11+
MOCK_CHROOT=epel-6-cernonly-x86_64
12+
MOCK_FLAGS=--verbose
13+
14+
15+
RPMDEFINES_SRC=--define='_topdir $(RPMBUILD)' \
16+
--define='_sourcedir $(CWD)' \
17+
--define='_builddir %{_topdir}/BUILD' \
18+
--define='_srcrpmdir $(SRPMS)' \
19+
--define='_rpmdir $(RPMS)'
20+
21+
RPMDEFINES_BIN=--define='_topdir $(RPMBUILD)' \
22+
--define='_sourcedir %{_topdir}/SOURCES' \
23+
--define='_builddir %{_topdir}/BUILD' \
24+
--define='_srcrpmdir $(SRPMS).' \
25+
--define='_rpmdir $(RPMS)'
26+
27+
28+
all: srpm
29+
30+
clean:
31+
rm -fv *.tar.gz
32+
rm -fv *.rpm
33+
rm -fv *.log
34+
rm -rfv out
35+
rm -rfv "$(RPMBUILD)"
36+
37+
dist: clean
38+
tar vczf "$(NAME)-$(VERSION).tar.gz" --exclude="packaging" --exclude=".git" --exclude="*.pyc" --transform="s,^,$(NAME)-$(VERSION)/," ..
39+
40+
$(RPMBUILD):
41+
mkdir -p "$(RPMBUILD)"
42+
43+
srpm: dist $(SPEC) $(RPMBUILD)
44+
/usr/bin/rpmbuild --nodeps -bs $(RPMDEFINES_SRC) $(SPEC)
45+
46+
rpm: srpm
47+
/usr/bin/rpmbuild --rebuild $(RPMDEFINES_BIN) $(NAME)-$(VERSION)-*.src.rpm
48+
49+
mock: srpm
50+
/usr/bin/mock $(MOCK_FLAGS) -r $(MOCK_CHROOT) $(NAME)-$(VERSION)-*.src.rpm

packaging/rpm/Makefile

Lines changed: 0 additions & 39 deletions
This file was deleted.

packaging/rpm/Makefile_client

Lines changed: 0 additions & 38 deletions
This file was deleted.

packaging/rpm/specs-client/fts-client.spec renamed to packaging/rpm/fts-client.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ FTS python bindings for client libraries and DB API
7272
rm -rf %{buildroot}
7373

7474
%prep
75-
%setup -qc
75+
%setup -q
7676

7777
%build
7878
# Make sure the version in the spec file and the version used
Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ URL: http://fts3-service.web.cern.ch/
1717
# svn export https://svn.cern.ch/reps/fts3/trunk fts3
1818
# tar -czvf fts-3.2.34.tar.gz fts3
1919
Source0: https://grid-deployment.web.cern.ch/grid-deployment/dms/fts3/tar/%{name}-%{version}.tar.gz
20-
Source1: fts.te
21-
Source2: fts.fc
2220

2321
%if 0%{?el5}
2422
BuildRequires: activemq-cpp-library
@@ -196,9 +194,7 @@ The File Transfer Service V3 oracle plug-in
196194

197195

198196
%prep
199-
%setup -qc
200-
mkdir SELinux
201-
cp -p %{SOURCE1} %{SOURCE2} SELinux
197+
%setup -q
202198

203199
%build
204200
# Make sure the version in the spec file and the version used
@@ -233,7 +229,7 @@ make %{?_smp_mflags}
233229
cd -
234230

235231
# SELinux
236-
cd SELinux
232+
cd selinux
237233
for selinuxvariant in %{selinux_variants}; do
238234
make NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile
239235
mv fts.pp fts.pp.${selinuxvariant}
@@ -258,7 +254,7 @@ cd -
258254
# SELinux
259255
for selinuxvariant in %{selinux_variants}; do
260256
install -d %{buildroot}%{_datadir}/selinux/${selinuxvariant}
261-
install -p -m 644 SELinux/fts.pp.${selinuxvariant} %{buildroot}%{_datadir}/selinux/${selinuxvariant}/fts.pp
257+
install -p -m 644 selinux/fts.pp.${selinuxvariant} %{buildroot}%{_datadir}/selinux/${selinuxvariant}/fts.pp
262258
done
263259

264260
# Server scriptlets
@@ -470,7 +466,7 @@ fi
470466

471467
%files server-selinux
472468
%defattr(-,root,root,0755)
473-
%doc SELinux/*
469+
%doc selinux/*
474470
%{_datadir}/selinux/*/fts.pp
475471

476472
%files mysql

0 commit comments

Comments
 (0)