File: auto-multiple-choice.spec.in

package info (click to toggle)
auto-multiple-choice 1.4.0-2~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 18,520 kB
  • sloc: perl: 23,839; xml: 20,920; cpp: 1,791; makefile: 472; ansic: 186; sh: 80
file content (266 lines) | stat: -rw-r--r-- 8,209 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
# -*- coding:utf-8 -*-

%define AMC_modsdir %{_libdir}/AMC
%define AMC_modelsdir /usr/share/auto-multiple-choice/models
%define AMC_texdocdir /usr/share/texmf/doc/latex/AMC
%define AMC_texdir /usr/share/texmf/tex/latex/AMC
%define AMC_bindir %{_bindir}
%define AMC_pixdir /usr/share/pixmaps
%define AMC_iconsdir /usr/share/auto-multiple-choice/icons

%define AMC_texdocdir /usr/share/texmf-texlive/doc/AMC
%if 0%{?suse_version}
%define AMC_texdocdir /usr/lib/texmf/doc/AMC
%else
%define AMC_texdocdir /usr/share/texmf/doc/latex/AMC
%endif

%if 0%{?fedora}
%define AMC_perldir %{perl_privlib}
%else
%define AMC_perldir %{perl_vendorlib}
%endif

%define AMC_man1dir %{_mandir}/man1
%define AMC_docdir %{_docdir}/%{name}

%define AMC_OPENCV -I /usr/include/opencv

%if 0%{?suse_version}
%define AMC_cat Education;Teaching;
%else
%define AMC_cat Education;
%endif

%define AMC_makepass SYSTEM_TYPE=rpm MODSDIR=%{AMC_modsdir} MODELSDIR=%{AMC_modelsdir} TEXDOCDIR=%{AMC_texdocdir} TEXDIR=%{AMC_texdir} BINDIR=%{AMC_bindir} ICONSDIR=%{AMC_iconsdir} PIXDIR=%{AMC_pixdir} PERLDIR=%{AMC_perldir} MAN1DIR=%{AMC_man1dir} DOCDIR=%{AMC_docdir} DESKTOPDIR="" DESKTOP_CAT="%{AMC_cat}" GCC_OPENCV="%{AMC_OPENCV}"

Name: auto-multiple-choice
Summary: Auto Multiple Choice - Multiple Choice Papers Management
Version: @/PACKAGE_V_DEB/@
Release: 1%{?dist}
License: GPLv2+
Group: Productivity/Other
Source: auto-multiple-choice_@/PACKAGE_V_DEB/@_precomp.tar.gz
%if 0%{?fedora}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
%else
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%endif
URL: https://www.auto-multiple-choice.net/
Packager: Alexis Bienvenüe <pado@passoire.fr>
BuildRequires: gcc-c++
%if 0%{?suse_version}
BuildRequires: update-desktop-files, libnetpbm-devel, texlive, fontconfig-devel, opencv-devel
%endif
%if 0%{?fedora}
BuildRequires: desktop-file-utils, netpbm-devel, texlive, fontconfig-devel, opencv-devel
%endif
%if 0%{?mandriva_version}
BuildRequires: desktop-file-utils, libnetpbm-devel, libfontconfig-devel, opencv-devel
%endif

%if 0%{?suse_version}
%if 0%{?suse_version} < 1140
Requires: perl = %{perl_version}
%else
%{perl_requires}
%endif
%else
Requires: perl >= 5.8
%endif

Requires: ghostscript
Requires: /usr/bin/ppmtoxpm
Requires: /usr/bin/dvipdfm

%if 0%{?suse_version} > 1000
Suggests: perl(Email::Simple), perl(Email::MIME), perl(Email::Address), perl(Email::Sender), perl(Email::Sender::Simple), perl(Email::Date::Format)
%else
Requires: perl(Email::Simple), perl(Email::MIME), perl(Email::Address), perl(Email::Sender), perl(Email::Sender::Simple), perl(Email::Date::Format)
%endif

Requires: perl(DBI), perl(DBD::SQLite)

%if 0%{?mandriva_version}
Requires: poppler, graphicsmagick, imagemagick, tetex-cmsuper
%else
Requires: /usr/bin/pdftoppm, GraphicsMagick, ImageMagick
%endif

%if 0%{?suse_version}
Requires: poppler >= 0.12.3, poppler-tools >= 0.12.3
Requires: texlive, texlive-bin-latex, texlive-latex
BuildRequires: texlive, texlive-bin-latex, texlive-latex
Requires: perl(Archive::Tar), perl(Data::Dumper), perl(Encode), perl(Exporter), perl(Fcntl), perl(File::Copy), perl(File::Path), perl(File::Spec), perl(File::Spec::Functions), perl(File::Temp), perl(Getopt::Long), perl(Gtk2), perl(I18N::Langinfo), perl(IO::File), perl(IO::Select), perl(IPC::Open2), perl(Locale::gettext), perl(Module::Load), perl(Module::Load::Conditional), perl(POSIX), perl(Unicode::Normalize), perl(Time::Local), perl(XML::Simple), perl(XML::Writer), perl(constant), perl(encoding), perl(Digest::MD5), perl(Archive::Zip), perl(Text::CSV), perl(List::Util), perl(Text::ParseWords), perl(Cwd)
%endif

%if 0%{?fedora}
Requires: perl(Image::Magick)
%else
Requires: perl(Graphics::Magick)
%endif

%if 0%{?fedora}
Requires: texlive-latex, perl(Net::CUPS), perl(Net::CUPS::PPD), perl(Gtk2::Notify)
BuildRequires: texlive-latex
%if 0%{?fedora} < 18
Requires: texlive-texmf-latex
BuildRequires: texlive-texmf-latex
%endif
%endif
%if 0%{?mandriva_version}
Requires: tetex, tetex-latex, perl(Net::CUPS), perl(Net::CUPS::PPD), perl(Gtk2::Notify)
BuildRequires: tetex, tetex-latex
%endif

%if 0%{?mandriva_version}
Requires(post): tetex
Requires(postun): tetex
%else
Requires(post): texlive
Requires(postun): texlive
%endif

#################################################################
# DESCRIPTION                                                   #
#################################################################

%{?perl_default_filter}

%description
Utility to manage multiple choice questionnaires, with optionnaly
mixed questions and answers. AMC provides automatic marking from papers'
scans. Annotated papers are produced. Marks can be exported as a
OpenOffice.org sheet file.

#'

%prep

#################################################################
# SETUP                                                         #
#################################################################

%setup

%if 0%{?fedora}
# filter out package Perl modules, and optional OpenOffice::OODoc module.

cat << \EOF > %{name}-req
#!/bin/sh
%{__perl_requires} $* |\
sed -e '/perl(OpenOffice::OODoc)/d' -e '/perl(AMC::.*)/d'
EOF

%global __perl_requires %{_builddir}/%{name}-%{version}/%{name}-req
chmod +x %{__perl_requires}

%endif


#################################################################
# BUILD                                                         #
#################################################################

%build

make %{AMC_makepass} GCC_NETPBM="-I /usr/include/netpbm -lnetpbm" GCC="gcc" GCC_PP="g++" CFLAGS="$RPM_OPT_FLAGS -Wall" CXXFLAGS="$RPM_OPT_FLAGS -Wall"

#################################################################
# INSTALL                                                       #
#################################################################

%install
make DESTDIR=$RPM_BUILD_ROOT %{AMC_makepass} install

%if 0%{?fedora:1}%{?mandriva_version:1}
desktop-file-install --delete-original --dir=%{buildroot}%{_datadir}/applications auto-multiple-choice.desktop
%endif

%if 0%{?suse_version}
%suse_update_desktop_file -i %{name}
%endif

%find_lang %{name}

#################################################################
# CLEAN                                                         #
#################################################################

%clean
rm -rf $RPM_BUILD_ROOT

#################################################################
# FILES                                                         #
#################################################################

%files -f %{name}.lang
%defattr(-,root,root,-)

%doc COPYING ChangeLog doc/html doc/auto-multiple-choice.??.xml doc/auto-multiple-choice.??.pdf
%doc %{AMC_texdocdir}
%doc %{AMC_docdir}

%dir /usr/share/auto-multiple-choice
%dir /usr/share/texmf
%dir /usr/share/texmf/tex
%dir /usr/share/texmf/tex/latex

%if 0%{?suse_version}
%dir /usr/lib/texmf/doc
%endif

%{AMC_modsdir}
%{AMC_modelsdir}
%{AMC_iconsdir}
%{AMC_texdir}
%{AMC_bindir}/auto-multiple-choice
%{AMC_pixdir}/auto-multiple-choice.xpm
%{AMC_perldir}/AMC
%{_datadir}/applications/auto-multiple-choice.desktop
%{AMC_man1dir}/auto-multiple-choice.*.1*
%{AMC_man1dir}/auto-multiple-choice.1*
%{AMC_man1dir}/AMC-*.1*

/usr/share/gtksourceview-3.0
/usr/share/gtksourceview-3.0/language-specs
/usr/share/gtksourceview-3.0/language-specs/amc-txt.lang
/usr/share/mime/packages/auto-multiple-choice.xml

#################################################################
# POST                                                          #
#################################################################

%post

%if 0%{?fedora}
texhash
%endif
%if 0%{?suse_version}
texconfig-sys rehash
%endif
%if 0%{?mandriva_version}
texconfig-sys rehash
%endif

%postun

%if 0%{?fedora}
texhash
%endif
%if 0%{?suse_version}
texconfig-sys rehash
%endif
%if 0%{?mandriva_version}
texhash
%endif

#################################################################
# CHANGELOG                                                     #
#################################################################

%changelog

* @/DATE_RPMCHL/@ Alexis Bienvenue <pado@passoire.fr> @/PACKAGE_V_DEB/@-1

  - auto spec file for Fedora and SUSE. See ChangeLog for information.