From 506d211a70ae9833482fcc4ca0af5c167abe3c0e Mon Sep 17 00:00:00 2001 From: Christopher Meng Date: Wed, 20 Nov 2013 09:06:02 +0800 Subject: [PATCH] Initial SETUP. --- .gitignore | 1 + ...ba18ff2981beb68f38ea817d0e8226950a85.patch | 47 +++++++++++++++++++ pgpdump.spec | 38 +++++++++++++++ sources | 1 + 4 files changed, 87 insertions(+) create mode 100644 1201ba18ff2981beb68f38ea817d0e8226950a85.patch create mode 100644 pgpdump.spec diff --git a/.gitignore b/.gitignore index e69de29..cb4e8a6 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/pgpdump-0.28.tar.gz diff --git a/1201ba18ff2981beb68f38ea817d0e8226950a85.patch b/1201ba18ff2981beb68f38ea817d0e8226950a85.patch new file mode 100644 index 0000000..86f2412 --- /dev/null +++ b/1201ba18ff2981beb68f38ea817d0e8226950a85.patch @@ -0,0 +1,47 @@ +From 1201ba18ff2981beb68f38ea817d0e8226950a85 Mon Sep 17 00:00:00 2001 +From: Christopher Meng +Date: Fri, 15 Nov 2013 11:14:56 +0800 +Subject: [PATCH] Adaption for Fedora packaging. + +1. Preserve the timestamp.(Will help people to see the real time of files were generated) + +2. Correct the permissions for standard. As far as I can tell you, 755 is the standard for binaries and 644 is the standard for non-executable files. + +3. Add DESTDIR support as RPM needs to install files to a pseudo folder first which doesn't need to be granted any root access like /usr, and when we build RPMs we never use root to build. + +PS: I'm packaging pgpdump for Fedora. +--- + Makefile.in | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/Makefile.in b/Makefile.in +index a0269a3..b7528ff 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -8,7 +8,7 @@ LDFLAGS = @LDFLAGS@ + VERSION = `git tag | tail -1 | sed -e 's/v//'` + + RM = rm -f +-INSTALL = install -c ++INSTALL = install -cp + + INCS = pgpdump.h + SRCS = pgpdump.c types.c tagfuncs.c packet.c subfunc.c signature.c keys.c \ +@@ -37,10 +37,10 @@ distclean: + $(RM) $(OBJS) $(PROG) $(CNF) $(MKF) + + install: all +- $(INSTALL) -d $(bindir) +- $(INSTALL) -m 555 $(PROG) $(bindir) +- $(INSTALL) -d $(mandir)/man1 +- $(INSTALL) -m 444 $(MAN) $(mandir)/man1 ++ $(INSTALL) -d $(DESTDIR)$(bindir) ++ $(INSTALL) -pm755 $(PROG) $(DESTDIR)$(bindir) ++ $(INSTALL) -d $(DESTDIR)$(mandir)/man1 ++ $(INSTALL) -pm644 $(MAN) $(DESTDIR)$(mandir)/man1 + + archive: + git archive master -o ~/pgpdump-$(VERSION).tar --prefix=pgpdump-$(VERSION)/ +-- +1.8.4 + diff --git a/pgpdump.spec b/pgpdump.spec new file mode 100644 index 0000000..dcd76dc --- /dev/null +++ b/pgpdump.spec @@ -0,0 +1,38 @@ +Name: pgpdump +Version: 0.28 +Release: 1%{?dist} +Summary: PGP packet visualizer +License: MIT +URL: http://www.mew.org/~kazu/proj/pgpdump/ +Source0: http://www.mew.org/~kazu/proj/pgpdump/%{name}-%{version}.tar.gz +# The patch being merged into upstream solved: +# 1. Wrong permissions like 555 but not 755, 444 but not 644. +# 2. RPM DESTDIR support +# 3. Preserve the timestamp when installing files. +Patch0: https://github.com/cicku/pgpdump/commit/1201ba18ff2981beb68f38ea817d0e8226950a85.patch +BuildRequires: bzip2-devel +BuildRequires: zlib-devel + +%description +pgpdump is a PGP packet visualizer which displays the packet format of +OpenPGP (RFC 4880) and PGP version 2 (RFC 1991). + +%prep +%setup -q +%patch0 -p1 + +%build +%configure +make %{?_smp_mflags} + +%install +make install DESTDIR=%{buildroot} + +%files +%doc CHANGES COPYRIGHT README.md +%{_bindir}/pgpdump +%{_mandir}/man1/pgpdump.1* + +%changelog +* Fri Aug 09 2013 Christopher Meng - 0.28-1 +- Initial Package. diff --git a/sources b/sources index e69de29..5a15766 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +4a98f608c8f295e5415c1ea0b5c35d83 pgpdump-0.28.tar.gz