Imported new upstream release for gpgdir.
[pgp-tools.git] / gpgdir / packaging / gpgdir.spec
1 %define name gpgdir
2 %define version 1.9.5
3 %define release 1
4 %define gpgdirlibdir %_libdir/%name
5
6 ### get the first @INC directory that includes the string "linux".
7 ### This may be 'i386-linux', or 'i686-linux-thread-multi', etc.
8 %define gpgdirmoddir `perl -e '$path='i386-linux'; for (@INC) { if($_ =~ m|.*/(.*linux.*)|) {$path = $1; last; }} print $path'`
9
10 Summary: Gpgdir recursively encrypts/decrypts directories with GnuPG.
11 Name: %name
12 Version: %version
13 Release: %release
14 License: GPL
15 Group: Applications/Cryptography
16 Url: http://www.cipherdyne.org/gpgdir/
17 Source: %name-%version.tar.gz
18 BuildRoot: %_tmppath/%{name}-buildroot
19 BuildRequires: perl-ExtUtils-MakeMaker
20 #Prereq: rpm-helper
21
22 %description
23 gpgdir is a perl script that uses the CPAN GnuPG::Interface perl module to encrypt
24 and decrypt directories using a gpg key specified in ~/.gpgdirrc. gpgdir recursively
25 descends through a directory in order to make sure it encrypts or decrypts every file
26 in a directory and all of its subdirectories. By default the mtime and atime values
27 of all files will be preserved upon encryption and decryption (this can be disabled
28 with the --no-preserve-times option). Note that in --encrypt mode, gpgdir will
29 delete the original files that it successfully encrypts (unless the --no-delete
30 option is given). However, upon startup gpgdir first asks for a the decryption pass-
31 word to be sure that a dummy file can successfully be encrypted and decrypted. The
32 initial test can be disabled with the --skip-test option so that a directory can eas-
33 ily be encrypted without having to also specify a password (this is consistent with
34 gpg behavior). Also, note that gpgdir is careful not encrypt hidden files and direc-
35 tories. After all, you probably don't want your ~/.gnupg directory or ~/.bashrc file
36 to be encrypted.
37
38 %prep
39 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
40
41 %setup -q
42 for i in $(grep -r "use lib" . | cut -d: -f1); do
43 awk '/use lib/ { sub("/usr/lib/gpgdir", "%_libdir/%name") } { print }' $i > $i.tmp
44 mv $i.tmp $i
45 done
46
47 cd deps
48 cd Class-MethodMaker && perl Makefile.PL PREFIX=%gpgdirlibdir LIB=%gpgdirlibdir
49 cd ..
50 cd GnuPG-Interface && perl Makefile.PL PREFIX=%gpgdirlibdir LIB=%gpgdirlibdir
51 cd ..
52 cd TermReadKey && perl Makefile.PL PREFIX=%gpgdirlibdir LIB=%gpgdirlibdir
53 cd ../..
54
55 %build
56
57 ### build perl modules used by gpgdir
58 cd deps
59 make OPTS="$RPM_OPT_FLAGS" -C Class-MethodMaker
60 make OPTS="$RPM_OPT_FLAGS" -C GnuPG-Interface
61 make OPTS="$RPM_OPT_FLAGS" -C TermReadKey
62 cd ..
63
64 %install
65
66 ### gpgdir module dirs
67 cd deps
68 mkdir -p $RPM_BUILD_ROOT%gpgdirlibdir/%gpgdirmoddir/auto/Term/ReadKey
69 mkdir -p $RPM_BUILD_ROOT%gpgdirlibdir/%gpgdirmoddir/auto/Class/MethodMaker/array
70 mkdir -p $RPM_BUILD_ROOT%gpgdirlibdir/%gpgdirmoddir/auto/Class/MethodMaker/Engine
71 mkdir -p $RPM_BUILD_ROOT%gpgdirlibdir/%gpgdirmoddir/auto/Class/MethodMaker/hash
72 mkdir -p $RPM_BUILD_ROOT%gpgdirlibdir/%gpgdirmoddir/auto/Class/MethodMaker/scalar
73 mkdir -p $RPM_BUILD_ROOT%gpgdirlibdir/%gpgdirmoddir/Class/MethodMaker
74 mkdir -p $RPM_BUILD_ROOT%gpgdirlibdir/%gpgdirmoddir/Term
75 mkdir -p $RPM_BUILD_ROOT%gpgdirlibdir/auto/GnuPG/Interface
76 mkdir -p $RPM_BUILD_ROOT%gpgdirlibdir/GnuPG
77 mkdir -p $RPM_BUILD_ROOT%_bindir
78 mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1
79 mkdir -p $RPM_BUILD_ROOT%_sbindir
80 cd ..
81
82 install -m 755 gpgdir $RPM_BUILD_ROOT%_bindir/
83 install -m 644 gpgdir.1 $RPM_BUILD_ROOT%{_mandir}/man1/
84
85 ### install perl modules used by gpgdir
86 cd deps
87 install -m 444 Class-MethodMaker/blib/lib/auto/Class/MethodMaker/array/*.* $RPM_BUILD_ROOT%gpgdirlibdir/%gpgdirmoddir/auto/Class/MethodMaker/array/
88 install -m 444 Class-MethodMaker/blib/lib/auto/Class/MethodMaker/scalar/*.* $RPM_BUILD_ROOT%gpgdirlibdir/%gpgdirmoddir/auto/Class/MethodMaker/scalar/
89 install -m 444 Class-MethodMaker/blib/lib/auto/Class/MethodMaker/hash/*.* $RPM_BUILD_ROOT%gpgdirlibdir/%gpgdirmoddir/auto/Class/MethodMaker/hash/
90 install -m 444 Class-MethodMaker/blib/lib/auto/Class/MethodMaker/Engine/*.* $RPM_BUILD_ROOT%gpgdirlibdir/%gpgdirmoddir/auto/Class/MethodMaker/Engine/
91 install -m 444 Class-MethodMaker/blib/arch/auto/Class/MethodMaker/MethodMaker.bs $RPM_BUILD_ROOT%gpgdirlibdir/%gpgdirmoddir/auto/Class/MethodMaker/MethodMaker.bs
92 install -m 444 Class-MethodMaker/blib/arch/auto/Class/MethodMaker/MethodMaker.so $RPM_BUILD_ROOT%gpgdirlibdir/%gpgdirmoddir/auto/Class/MethodMaker/MethodMaker.so
93 install -m 444 Class-MethodMaker/blib/lib/Class/MethodMaker.pm $RPM_BUILD_ROOT%gpgdirlibdir/%gpgdirmoddir/Class/MethodMaker.pm
94 install -m 444 Class-MethodMaker/blib/lib/Class/MethodMaker/*.pm $RPM_BUILD_ROOT%gpgdirlibdir/%gpgdirmoddir/Class/MethodMaker
95 install -m 444 GnuPG-Interface/blib/lib/auto/GnuPG/Interface/*.* $RPM_BUILD_ROOT%gpgdirlibdir/auto/GnuPG/Interface/
96 install -m 444 GnuPG-Interface/blib/lib/GnuPG/*.pm $RPM_BUILD_ROOT%gpgdirlibdir/GnuPG/
97 install -m 444 TermReadKey/blib/lib/Term/ReadKey.pm $RPM_BUILD_ROOT%gpgdirlibdir/%gpgdirmoddir/Term/ReadKey.pm
98 install -m 444 TermReadKey/blib/lib/auto/Term/ReadKey/autosplit.ix $RPM_BUILD_ROOT%gpgdirlibdir/%gpgdirmoddir/auto/Term/ReadKey/autosplit.ix
99 install -m 444 TermReadKey/blib/arch/auto/Term/ReadKey/ReadKey.bs $RPM_BUILD_ROOT%gpgdirlibdir/%gpgdirmoddir/auto/Term/ReadKey/ReadKey.bs
100 install -m 444 TermReadKey/blib/arch/auto/Term/ReadKey/ReadKey.so $RPM_BUILD_ROOT%gpgdirlibdir/%gpgdirmoddir/auto/Term/ReadKey/ReadKey.so
101 cd ..
102
103 %clean
104 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
105
106 %pre
107
108 %post
109
110 %preun
111
112 %files
113 %defattr(-,root,root)
114 %_bindir/*
115 %{_mandir}/man1/*
116 %_libdir/%name
117
118 %changelog
119 * Sat Sep 05 2009 Michael Rash <mbr@cipherdyne.org>
120 - gpgdir-1.9.5 release
121
122 * Thu Feb 12 2009 Michael Rash <mbr@cipherdyne.org>
123 - gpgdir-1.9.4 release
124
125 * Wed Nov 11 2008 Michael Rash <mbr@cipherdyne.org>
126 - gpgdir-1.9.3 release
127
128 * Sun Aug 31 2008 Michael Rash <mbr@cipherdyne.org>
129 - Updated to use the deps/ directory for all perl module sources.
130 - gpgdir-1.9.2 release
131
132 * Sat Jun 07 2008 Michael Rash <mbr@cipherdyne.org>
133 - gpgdir-1.9.1 release
134
135 * Sat May 31 2008 Michael Rash <mbr@cipherdyne.org>
136 - gpgdir-1.9 release
137
138 * Mon Feb 18 2008 Michael Rash <mbr@cipherdyne.org>
139 - gpgdir-1.8 release
140
141 * Mon Feb 18 2008 Michael Rash <mbr@cipherdyne.org>
142 - gpgdir-1.7 release
143
144 * Sun Feb 17 2008 Michael Rash <mbr@cipherdyne.org>
145 - gpgdir-1.6 release
146
147 * Fri Aug 31 2007 Michael Rash <mbr@cipherdyne.org>
148 - gpgdir-1.5 release
149
150 * Sat Jul 20 2007 Michael Rash <mbr@cipherdyne.org>
151 - gpgdir-1.4 release
152
153 * Sat Jun 09 2007 Michael Rash <mbr@cipherdyne.org>
154 - gpgdir-1.3 release
155
156 * Mon May 28 2007 Michael Rash <mbr@cipherdyne.org>
157 - gpgdir-1.2 release
158
159 * Mon May 21 2007 Michael Rash <mbr@cipherdyne.org>
160 - gpgdir-1.1 release
161
162 * Sun Sep 17 2006 Michael Rash <mbr@cipherdyne.org>
163 - gpgdir-1.0.3 release (1.0.2 was skipped accidentally).
164
165 * Sat Sep 16 2006 Michael Rash <mbr@cipherdyne.org>
166 - Added x86_64 RPM.
167 - Removed iptables as a prerequisite.
168 - gpgdir-1.0.1 release
169
170 * Wed Sep 13 2006 Michael Rash <mbr@cipherdyne.org>
171 - gpgdir-1.0 release
172
173 * Thu Sep 09 2006 Michael Rash <mbr@cipherdyne.org>
174 - Initial RPM release of gpgdir-0.9.9