Skip to content

Commit 651a8d0

Browse files
committed
RPM build scripts
1 parent c873c55 commit 651a8d0

File tree

5 files changed

+84
-1
lines changed

5 files changed

+84
-1
lines changed

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
*.o
22
src/bgp-explain
3+
src/msort-test
34
test/misalignment
45
test/mrt-header
56
test/shift
@@ -9,3 +10,9 @@ debian/debhelper-build-stamp
910
debian/files
1011
debian/mrt-tools.substvars
1112
debian/mrt-tools
13+
rpm/BUILD
14+
rpm/RPMS
15+
rpm/BUILDROOT
16+
rpm/SOURCES
17+
rpm/SPECS
18+
rpm/SRPMS

INSTALL

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Unpackaged:
2+
3+
make
4+
sudo make install
5+
6+
7+
Debian/Ubuntu:
8+
9+
make debian
10+
sudo dpkg -i ../mrt-tools_VERSION.deb
11+
12+
13+
Red Hat / RPM:
14+
15+
make rpm
16+
sudo rpm -i rpm/RPMS/*/mrt-tools-VERSION.rpm
17+

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ clean:
66
$(MAKE) -C src clean
77
$(MAKE) -C test clean
88

9-
.PHONY: debian test
9+
.PHONY: debian test rpm
1010

1111
debian:
1212
dpkg-buildpackage -b --no-sign
@@ -29,5 +29,11 @@ lintian:
2929
lintian --no-tag-display-limit --suppress-tags dir-or-file-in-opt \
3030
--suppress-tags repeated-path-segment --verbose --info --pedantic
3131

32+
rpm:
33+
rpmbuild --define "_topdir `pwd`/rpm" -bb rpm/mrt-tools.spec
34+
3235
test: all
3336
$(MAKE) -C test
37+
38+
install: all
39+
install -m 755 src/bgp-explain /usr/local/bin/bgp-explain

rpm/copysource.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/sh
2+
3+
SOURCEDIR=$1
4+
DESTDIR=$2
5+
6+
umask 022
7+
rm -rf ${DESTDIR}
8+
mkdir -p ${DESTDIR}
9+
cd ${SOURCEDIR}
10+
tar --exclude="rpm/[A-Z]*" -cpf ${DESTDIR}/source.tar .
11+
cd ${DESTDIR}
12+
tar -xpf source.tar
13+
rm source.tar
14+
exit 0
15+

rpm/mrt-tools.spec

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
Name: mrt-tools
2+
Version: 0.1
3+
Release: 1%{?dist}
4+
Summary: Tools for working with BGP MRT data files
5+
6+
#Group:
7+
License: GPL-2.0
8+
URL: https://github.com/CAIDA/mrt-tools
9+
#Source0:
10+
11+
#BuildRequires:
12+
#Requires:
13+
14+
%description
15+
currently includes bgp-explain
16+
17+
%prep
18+
%{_topdir}/copysource.sh %{_topdir}/.. %{_topdir}/BUILD
19+
20+
%build
21+
#%%configure
22+
make %{?_smp_mflags}
23+
24+
%install
25+
#%make_install
26+
umask 022
27+
mkdir -p %{buildroot}/usr/bin
28+
install -m 0755 src/bgp-explain %{buildroot}/usr/bin/bgp-explain
29+
30+
%files
31+
%defattr(-, root, root)
32+
/usr/bin/bgp-explain
33+
%doc
34+
35+
%changelog
36+
* Sat Mar 1 2025 William Herrin <herrin@caida.org> - 0.1
37+
- initial version
38+

0 commit comments

Comments
 (0)