add cdinfo.c
[platform/upstream/cdrkit.git] / packaging / cdrkit.spec
1 Name:           cdrkit
2 Version:        1.1.11
3 Release:        0
4 Summary:        Tool for Writing CDRs
5 License:        GPL-2.0
6 Url:            http://cdrkit.org/
7 Group:          Applications/Other
8 Source0:        http://cdrkit.org/releases/cdrkit-%{version}.tar.gz
9 Source1:        scan_scsi.linux
10 Source2:        cdinfo.c
11 BuildRequires:  cmake
12 BuildRequires:  fdupes
13 BuildRequires:  file-devel
14 BuildRequires:  gcc-c++
15 BuildRequires:  bzip2-devel 
16 BuildRequires:  libcap-devel
17 BuildRequires:  perl
18 BuildRequires:  zlib-devel
19 Provides:       wodim    = %{version}
20 Provides:       cdrecord = %{version}
21 Obsoletes:      cdrecord < %{version}
22
23 %description
24 wodim is used to record data or audio CDs on a CD-Recorder or to write
25 DVD media on a DVD-Recorder.
26
27 %package -n cdrkit-devel-static
28 License:        GPL-2.0
29 Summary:        Tool for Writing CDRs - Files Mandatory for Development
30 Group:          Development/Libraries
31 Provides:       cdrecord-devel = %{version}
32 Provides:       cdrtools-devel = %{version}
33 Provides:       wodim-devel = %{version}
34 Obsoletes:      cdrecord-devel < %{version}
35 Obsoletes:      cdrtools-devel < %{version}
36 Obsoletes:      wodim-devel < %{version}
37
38 %description -n cdrkit-devel-static
39 This package contains cdrkit libraries mandatory for development.
40
41 %package -n genisoimage
42 License:        GPL-2.0
43 Summary:        A Program for Creating CDs in Linux
44 Group:          Applications/Other
45 Recommends:     zisofs-tools
46 Provides:       mkisofs = %{version}
47 Obsoletes:      mkisofs < %{version}
48
49 %description -n genisoimage
50 Genisoimage is a pre-mastering program that generates an iso9660
51 filesystem. It takes a snapshot of a given directory tree, and
52 generates a binary image which corresponds to an iso9660 filesystem
53 that can be written to a block device.
54
55 %package -n icedax
56 License:        GPL-2.0
57 Summary:        A CD-Audio Grabbing tool
58 Group:          Applications/Other
59 Requires:       vorbis-tools
60 Provides:       cdda2wav = %{version}
61 Obsoletes:      cdda2wav < %{version}
62
63 %description -n icedax
64 The common CD-audio grabbing tool for Linux. The sources are now
65 contained in the wodim source archive.
66
67 %package -n cdrkit-cdrtools-compat
68 License:        GPL-2.0
69 Summary:        Tool for Writing CDRs - cdrtools Compatibility Package
70 Group:          Applications/Other
71 Requires:       genisoimage = %{version}-%{release}
72 Requires:       icedax = %{version}-%{release}
73 Requires:       wodim = %{version}-%{release}
74
75 %description -n 'cdrkit-cdrtools-compat'
76 This package contains these compatibility symlinks:
77 cdrecord -> wodim
78 mkisofs -> genisoimage
79 cdda2wav -> icedax
80 Install this package if you can't use the cdrkit programs directly.
81
82 Requires:       genisoimage = %%{version-%%{release}
83 Requires:       wodim = %%{version-%%{release}
84 %prep
85 %setup -q -n cdrkit-%{version}
86 # Fix perl path
87 find . -type f -print0 | xargs -0 perl -pi -e 's#/usr/local/bin/perl#/usr/bin/perl#g'
88 # Fix permissions (no executables in doc files)
89 chmod 644 doc/icedax/tracknames.pl misc/burnstuff misc/rc.pp
90 # Rename in order to not conflict with doc/genisoimage/README when added in genisoimage rpm doc files
91 mv genisoimage/diag/README genisoimage/diag/README.diag
92
93 %build
94 export CFLAGS="%{optflags} -fno-strict-aliasing -DPIC -fPIC"
95 export CXXFLAGS="$CFLAGS"
96
97 mkdir build
98 cd build
99
100 cmake ../ -DCMAKE_INSTALL_PREFIX=%{_prefix}
101 make VERBOSE=1 MANDIR=share/man %{?_smp_mflags}
102 gcc %{optflags} %{S:2} -o cdinfo
103 cd ..
104
105 %install
106 cd build
107 %make_install
108 cd ..
109
110 # Fix perl version requirement
111 perl -pi -e 's#^require v5.8.1;##g' %{buildroot}%{_bindir}/dirsplit
112
113 # Install additional programs
114 install -pm 0755 build/cdinfo \
115                  icedax/cdda2mp3.new \
116                  icedax/inf2cdtext.pl \
117                  %{S:1} \
118                  %{buildroot}%{_bindir}
119 install -pm 0755 3rd-party/geteltorito/geteltorito.pl %{buildroot}%{_bindir}/geteltorito
120
121 ln -sf wodim %{buildroot}%{_bindir}/cdrecord
122 ln -sf wodim %{buildroot}%{_bindir}/dvdrecord
123 ln -sf readom %{buildroot}%{_bindir}/readcd
124 ln -sf icedax %{buildroot}%{_bindir}/cdda2wav
125 ln -sf genisoimage %{buildroot}%{_bindir}/mkhybrid
126 ln -sf genisoimage %{buildroot}%{_bindir}/mkisofs
127 ln -sf wodim.1%{ext_man} %{buildroot}%{_mandir}/man1/cdrecord.1%{ext_man}
128 ln -sf readom.1%{ext_man} %{buildroot}%{_mandir}/man1/readcd.1%{ext_man}
129 ln -sf icedax.1%{ext_man} %{buildroot}%{_mandir}/man1/cdda2wav.1%{ext_man}
130
131 ln -sf genisoimage.1%{ext_man} %{buildroot}%{_mandir}/man1/mkisofs.1%{ext_man}
132 ln -sf cdda2ogg.1%{ext_man} %{buildroot}%{_mandir}/man1/cdda2mp3.1%{ext_man}
133
134 # Install libraries
135 cd build
136 install -dm 0755 %{buildroot}%{_libdir}
137 install -pm 0644 libedc/libedc.a \
138                  libhfs_iso/libhfs_iso.a \
139                  libparanoia/libparanoia.a \
140                  librols/librols.a \
141                  libunls/libunls.a \
142                  libusal/libusal.a \
143                  %{buildroot}%{_libdir}
144 cd ..
145
146 # Install headers
147 rm -rf %{buildroot}%{_includedir}
148 mkdir -p %{buildroot}%{_includedir}/cdrkit
149 cp -a include/*.h %{buildroot}%{_includedir}/cdrkit
150 cp -a libusal/usal %{buildroot}%{_includedir}/
151 cp -a libusal/*.h %{buildroot}%{_includedir}/usal/
152 # it seems to depend on the cmake version if xconfig.h lands in ./ or in ./include/
153 # I don't know why, a cmake expert should fix that. Work around it for now.
154 cd build
155 if test -e xconfig.h; then # old cmake 2.6
156         cp -a xconfig.h %{buildroot}%{_includedir}/cdrkit
157 elif ! test -e include/xconfig.h; then # new cmake 2.8
158         echo "error: xconfig.h not found!"
159         false
160 fi
161 cd ..
162
163 # Install config files
164 install -dm 0755 %{buildroot}%{_sysconfdir}
165 install -pm 0644 netscsid/netscsid.dfl %{buildroot}%{_sysconfdir}/netscsid.conf
166 install -pm 0644 wodim/wodim.dfl %{buildroot}%{_sysconfdir}/wodim.conf
167
168 # Missing man page. Do symlink like in Debian.
169 ln -sf wodim.1%{ext_man} %{buildroot}%{_mandir}/man1/netscsid.1%{ext_man}
170
171 %fdupes -s %{buildroot}
172
173 %clean
174 rm -rf %{buildroot}
175
176 %verifyscript
177 %verify_permissions -e %{_bindir}/wodim
178
179 %post
180 %if 0%{?set_permissions:1} > 0
181   %{set_permissions wodim}
182 %else
183   %{run_permissions}
184 %endif
185
186 %files
187 %defattr(-,root,root,-)
188 %license COPYING
189 %config(noreplace) %{_sysconfdir}/netscsid.conf
190 %config(noreplace) %{_sysconfdir}/wodim.conf
191 %{_bindir}/cdinfo
192 %{_bindir}/readom
193 %verify(not mode) %attr(0755,root,root) %{_bindir}/wodim
194 %attr(0555,root,root) %{_sbindir}/netscsid
195 %doc %{_mandir}/man1/netscsid.1%{ext_man}
196 %doc %{_mandir}/man1/readom.1%{ext_man}
197 %doc %{_mandir}/man1/wodim.1%{ext_man}
198
199 %files -n cdrkit-cdrtools-compat
200 %defattr(-,root,root,-)
201 %{_bindir}/cdda2wav
202 %{_bindir}/cdrecord
203 %{_bindir}/dvdrecord
204 %{_bindir}/mkhybrid
205 %{_bindir}/mkisofs
206 %{_bindir}/readcd
207 %doc %{_mandir}/man1/cdda2wav.1%{ext_man}
208 %doc %{_mandir}/man1/cdrecord.1%{ext_man}
209 %doc %{_mandir}/man1/mkisofs.1%{ext_man}
210 %doc %{_mandir}/man1/readcd.1%{ext_man}
211
212 %files -n cdrkit-devel-static
213 %defattr(-,root,root,-)
214 %{_includedir}/cdrkit/
215 %{_includedir}/usal/
216 %{_libdir}/lib*.a
217
218 %files -n genisoimage
219 %defattr(-,root,root,-)
220 %{_bindir}/devdump
221 %{_bindir}/dirsplit
222 %{_bindir}/genisoimage
223 %{_bindir}/geteltorito
224 %{_bindir}/isodebug
225 %{_bindir}/isodump
226 %{_bindir}/isoinfo
227 %{_bindir}/isovfy
228 %doc %{_mandir}/man1/devdump.1%{ext_man}
229 %doc %{_mandir}/man1/dirsplit.1%{ext_man}
230 %doc %{_mandir}/man1/genisoimage.1%{ext_man}
231 %doc %{_mandir}/man1/isodebug.1%{ext_man}
232 %doc %{_mandir}/man1/isodump.1%{ext_man}
233 %doc %{_mandir}/man1/isoinfo.1%{ext_man}
234 %doc %{_mandir}/man1/isovfy.1%{ext_man}
235 %doc %{_mandir}/man5/genisoimagerc.5%{ext_man}
236
237 %files -n icedax
238 %defattr(-,root,root,-)
239 %{_bindir}/cdda2mp3
240 %{_bindir}/cdda2mp3.new
241 %{_bindir}/cdda2ogg
242 %{_bindir}/icedax
243 %{_bindir}/inf2cdtext.pl
244 %{_bindir}/pitchplay
245 %{_bindir}/readmult
246 %{_bindir}/scan_scsi.linux
247 %doc %{_mandir}/man1/cdda2mp3.1%{ext_man}
248 %doc %{_mandir}/man1/cdda2ogg.1%{ext_man}
249 %doc %{_mandir}/man1/icedax.1%{ext_man}
250 %doc %{_mandir}/man1/list_audio_tracks.1%{ext_man}
251 %doc %{_mandir}/man1/pitchplay.1%{ext_man}
252 %doc %{_mandir}/man1/readmult.1%{ext_man}
253