]> git.pld-linux.org Git - packages/gallery-remote.git/blob - gallery-remote.spec
- BR: unzip
[packages/gallery-remote.git] / gallery-remote.spec
1 #
2 %define         _base   1.5
3 %define         _rc             b32
4 %define         _rel    1
5 Summary:        Gallery Remote - client-side frontend to Gallery
6 Summary(pl.UTF-8):      Gallery Remote - frontend do Gallery działający po stronie klienta
7 Name:           gallery-remote
8 Version:        1.5.1
9 Release:        %{_rc}.%{_rel}
10 License:        GPL v2
11 Group:          Applications/Publishing
12 Source0:        http://dl.sourceforge.net/gallery/GalleryRemote.%{_base}.Linux.NoVM.bin
13 # Source0-md5:  521fb28f0027c4d7c84f7ef26c21b790
14 Source1:        http://www.gallery2.hu/download/GalleryRemote/gallery_remote_%{version}-%{_rc}.zip
15 # Source1-md5:  657d766c14a6e7e13b766b92dd67a13f
16 Source2:        %{name}.png
17 Source3:        %{name}.desktop
18 URL:            http://gallery.menalto.com/wiki/Gallery_Remote
19 BuildRequires:  sed >= 4.0
20 BuildRequires:  unzip
21 Requires:       ImageMagick
22 Requires:       ImageMagick-coder-jpeg
23 Requires:       ImageMagick-coder-jpeg2
24 Requires:       ImageMagick-coder-png
25 Requires:       ImageMagick-coder-tiff
26 Requires:       jre >= 1.4
27 Requires:       libjpeg-progs
28 BuildArch:      noarch
29 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30
31 %define         _appdir %{_datadir}/%{name}
32
33 %description
34 Gallery Remote is a client-side Java application that provides users
35 with a rich front-end to Gallery. This application makes it easier to
36 upload images to your Gallery.
37
38 %description -l pl.UTF-8
39 Gallery Remote to aplikacja w Javie działająca po stronie klienta
40 udostępniająca użytkownikom bogaty frontend do Gallery. Ta
41 aplikacja czyni łatwiejszym umieszczanie obrazków w Gallery.
42
43 %prep
44 %setup -qcT
45
46 # emulate the self-extractable installer
47 head -n 256 %{SOURCE0} > header
48 ARCHREALSIZE=$(awk -F= '/^ARCHREALSIZE=/{print $2}' header)
49 BLOCKSIZE=$(awk -F= '/^BLOCKSIZE=/{print $2}' header)
50 RESSIZE=$(awk -F= '/^RESSIZE=/{print $2}' header)
51 ARCHSTART=$(awk -F= '/^ARCHSTART=/{print $2}' header)
52 RESOURCE_ZIP=Resource1.zip
53 INSTALLER_BLOCKS=$(expr $ARCHREALSIZE / $BLOCKSIZE)
54 INSTALLER_REMAINDER=$(expr $ARCHREALSIZE % $BLOCKSIZE || :)
55 if [ ${INSTALLER_REMAINDER:-0} -gt 0 ]; then
56         INSTALLER_BLOCKS=$(expr $INSTALLER_BLOCKS + 1)
57 fi
58 dd if=%{SOURCE0} of="$RESOURCE_ZIP" bs=$BLOCKSIZE skip=`expr $ARCHSTART + $INSTALLER_BLOCKS` count=$RESSIZE
59
60 unzip -qq Resource1.zip
61 mv '$IA_PROJECT_DIR$'/* .
62
63 # should overwrite files from 1.5 according to http://gallery.menalto.com/wiki/Gallery_Remote
64 unzip -qq -o %{SOURCE1}
65
66 mv gallery_docs/dist/grpackage html
67 rm -f LICENSE # GPL v2
68 rm -rf */{win32,macos} # wrong os
69
70 # make it configured
71 mv imagemagick/im.properties{.preinstalled,}
72 mv imagemagick/HOWTO HOWTO.imagemagick
73
74 # and jpegtran too
75 mv jpegtran/{linux/,}jpegtran.properties
76 rm jpegtran/linux/jpegtran # binary
77 rm jpegtran/jpegtran.preinstalled
78 rm -rf jpegtran/linux
79 sed -i -e '/^jp\.path/s/=.*/=jpegtran/' jpegtran/jpegtran.properties
80 # undos
81 sed -i -e 's,\r$,,' jpegtran/jpegtran.properties
82
83 %install
84 rm -rf $RPM_BUILD_ROOT
85 install -d $RPM_BUILD_ROOT{%{_appdir},%{_bindir},%{_pixmapsdir},%{_desktopdir}}
86 cp -a imagemagick img jpegtran lib $RPM_BUILD_ROOT%{_appdir}
87 cp -a GalleryRemote.jar $RPM_BUILD_ROOT%{_appdir}
88 cat <<EOF > $RPM_BUILD_ROOT%{_bindir}/%{name}
89 #!/bin/sh
90 cd %{_appdir}
91 exec java -Xmx1024m -cp GalleryRemote.jar com.gallery.GalleryRemote.GalleryRemote
92 EOF
93 install %{SOURCE2} $RPM_BUILD_ROOT%{_pixmapsdir}
94 install %{SOURCE3} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
95
96 %clean
97 rm -rf $RPM_BUILD_ROOT
98
99 %files
100 %defattr(644,root,root,755)
101 %doc ChangeLog html
102 %attr(755,root,root) %{_bindir}/*
103 %{_appdir}
104 %{_desktopdir}/*.desktop
105 %{_pixmapsdir}/*.png
This page took 0.044383 seconds and 3 git commands to generate.