~ubuntu-branches/ubuntu/hardy/gnomad2/hardy

« back to all changes in this revision

Viewing changes to gnomad2.spec.in

  • Committer: Bazaar Package Importer
  • Author(s): Shaun Jackman
  • Date: 2004-10-25 10:24:21 UTC
  • Revision ID: james.westby@ubuntu.com-20041025102421-hnnl6uzlkutcibvi
Tags: upstream-2.5.0
ImportĀ upstreamĀ versionĀ 2.5.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%define name    @PACKAGE@
 
2
%define version @VERSION@
 
3
%define release 1
 
4
# Release scheme for different RPM-based distributions:
 
5
# release = "1" for distro-independent stuff like source packages
 
6
# release = "1.rh9" - release 1 for Red Hat Linux 9
 
7
# release = "1.FC1" -release 1 for Fedora Core Linux 1
 
8
%define prefix  /usr
 
9
 
 
10
# Considering that there is no reliable distribution of id3lib and
 
11
# libnjb, I usually link these statically by commenting them out
 
12
# below. This involves particular building procedures:
 
13
#
 
14
# First install id3lib and libnjb from source or packages, then
 
15
# break your packages :-) thusly:
 
16
#
 
17
# rm /usr/local/lib/libnjb.so*
 
18
# rm /usr/local/lib/libid3*so*
 
19
#
 
20
# The build will then automatically link to the static .a files
 
21
# instead. I haven't found any better way to do this unfortunately.
 
22
 
 
23
Summary:        Gnomad 2 is a Linux/BSD GNOME 2.0 client for the Nomad Jukebox
 
24
Name:           %{name}
 
25
Version:        %{version}
 
26
Release:        %{release}
 
27
Copyright:      GPL
 
28
URL:            http://gnomad2.sourceforge.net
 
29
Group:          Applications/Multimedia
 
30
Source0:        %{name}-%{version}.tar.gz
 
31
Packager:       Linus Walleij <triad@df.lth.se>
 
32
BuildRoot:      %{_builddir}/%{name}-%{version}-root
 
33
Requires:       glib2 >= @GLIB_REQUIRED@
 
34
Requires:       gtk2 >= @GTK_REQUIRED@
 
35
Requires:       libgnome >= @LIBGNOME_REQUIRED@
 
36
Requires:       libgnomeui >= @LIBGNOMEUI_REQUIRED@
 
37
Requires:       libusb >= 0.1.5
 
38
Requires:       libstdc++
 
39
Requires:       zlib
 
40
BuildRequires:  glib2-devel >= @GLIB_REQUIRED@
 
41
BuildRequires:  gtk2-devel >= @GTK_REQUIRED@
 
42
BuildRequires:  libgnome-devel >= @LIBGNOME_REQUIRED@
 
43
BuildRequires:  libgnomeui-devel >= @LIBGNOMEUI_REQUIRED@
 
44
BuildRequires:  libusb-devel >= 0.1.5
 
45
#BuildRequires: libnjb
 
46
#BuildRequires: id3lib-devel >= 3.8.0
 
47
Docdir:         %{prefix}/share/doc
 
48
Prefix:         %{_prefix}
 
49
 
 
50
%description
 
51
Gnomad 2 is a client for the Nomad Jukebox utilizing the
 
52
libnjb library for jukebox communication. It is used for
 
53
storing MP3 (and WAV, WMA) files on the jukebox and
 
54
retrieving them again, it also handles data file storage
 
55
and retrieval, playlists and a rudimentary player
 
56
with full support for the Creative EAX sound processor.
 
57
 
 
58
%prep
 
59
%setup 
 
60
 
 
61
%build
 
62
%configure
 
63
make RPM_OPT_FLAGS="$RPM_OPT_FLAGS"
 
64
 
 
65
%install
 
66
rm -rf $RPM_BUILD_ROOT
 
67
mkdir -p $RPM_BUILD_ROOT/etc/hotplug/usb
 
68
make DESTDIR=$RPM_BUILD_ROOT install
 
69
# install hotplug scripts so they are up to date
 
70
install -m 755 nomadjukebox $RPM_BUILD_ROOT/etc/hotplug/usb
 
71
install -m 644 nomad.usermap $RPM_BUILD_ROOT/etc/hotplug/usb
 
72
 
 
73
%post
 
74
# This is much because RedHat use an old hotplug version that
 
75
# doesn't recognize the personalized usermap properly.
 
76
function inmap {
 
77
    while read LINE; do
 
78
        if [ "x${LINE}" != "x" ]; then
 
79
            firstword=`echo ${LINE} | awk '{ print $1 }'`
 
80
            if [ ${firstword} != "#" ]; then
 
81
                script=${firstword}
 
82
                manid=`echo ${LINE} | awk '{ print $3 }'`
 
83
                productid=`echo ${LINE} | awk '{ print $4 }'`
 
84
                if [ "x${script}" = "x$2" ]; then 
 
85
                    if [ "x${manid}" = "x$3" ]; then 
 
86
                        if [ "x${productid}" = "x$4" ]; then
 
87
                            echo "yes"
 
88
                            return 0
 
89
                        fi
 
90
                    fi
 
91
                fi
 
92
            fi
 
93
        fi
 
94
    done < $1
 
95
    echo "no"
 
96
    return 0
 
97
}
 
98
function patchusermap {
 
99
    comment=""
 
100
    while read LINE; do
 
101
        if [ "x$LINE" != "x" ]; then
 
102
            firstword=`echo ${LINE} | awk '{ print $1 }'`
 
103
            if [ ${firstword} = "#" ]; then
 
104
                comment=${LINE}
 
105
            else
 
106
                script=${firstword}
 
107
                manid=`echo ${LINE} | awk '{ print $3 }'`
 
108
                productid=`echo ${LINE} | awk '{ print $4 }'`
 
109
                if [ "x${manid}" != "x" ]; then
 
110
                    echo "Checking for product ${productid} in $2..."
 
111
                    if [ `inmap $2 ${script} ${manid} ${productid}` = "no" ]; then
 
112
                        echo "Not present, adding to hotplug map."
 
113
                        echo ${LINE} >> $2
 
114
                        comment=""
 
115
                    else
 
116
                        echo "Already installed."
 
117
                    fi
 
118
                fi
 
119
            fi
 
120
        fi
 
121
    done < $1
 
122
}
 
123
# echo "Checking hotplugging CVS version..."
 
124
# echo "/etc/hotplug/usb/*.usermap support was added in august 2002"
 
125
EDITMAP="yes"
 
126
CVSTAG=`grep '\$Id:' /etc/hotplug/usb.agent`
 
127
if [ "x${CVSTAG}" != "x" ]; then
 
128
    DATE=`echo ${CVSTAG} | awk '{ print $5 }'`
 
129
    # echo "Hotplug version seems to be from ${DATE}"
 
130
    YEAR=`echo ${DATE} | awk 'BEGIN { FS="/"} {print $1; }'`
 
131
    MONTH=`echo ${DATE} | awk 'BEGIN { FS="/"} {print $2; }'`
 
132
    DAY=`echo ${DATE} | awk 'BEGIN { FS="/"} {print $3; }'`
 
133
    if [ "${YEAR}" -gt "2002" ]; then
 
134
        EDITMAP="no"
 
135
    else
 
136
        if [ "${YEAR}" -eq "2002" ]; then
 
137
            if [ "${MONTH}" -ge "08" ]; then
 
138
                EDITMAP="no"
 
139
            fi
 
140
        fi
 
141
    fi
 
142
fi
 
143
if [ "x${EDITMAP}" = "xyes" ]; then
 
144
    echo "We need to edit the ${HOTPLUGPATH}/usb.usermap if it exists..."
 
145
    patchusermap /etc/hotplug/usb/nomad.usermap /etc/hotplug/usb.usermap
 
146
else
 
147
    # echo "No need to edit the ${HOTPLUGPATH}/usb.usermap file."
 
148
fi
 
149
 
 
150
%postun
 
151
# Remove entries from the usermap? What if someone has installed
 
152
# another program or from source? No way. See if the "nomadjukebox"
 
153
# script is still there, else remove the entries.
 
154
if test -f /etc/hotplug/usb/nomadjukebox
 
155
then
 
156
    # Nothing
 
157
    # echo "Nothing to remove from usb.usermap."
 
158
else
 
159
    # echo "Checking hotplugging CVS version..."
 
160
    # echo "/etc/hotplug/usb/*.usermap support was added in august 2002"
 
161
    EDITMAP="yes"
 
162
    CVSTAG=`grep '\$Id:' /etc/hotplug/usb.agent`
 
163
    if [ "x${CVSTAG}" != "x" ]; then
 
164
        DATE=`echo ${CVSTAG} | awk '{ print $5 }'`
 
165
        # echo "Hotplug version seems to be from ${DATE}"
 
166
        YEAR=`echo ${DATE} | awk 'BEGIN { FS="/"} {print $1; }'`
 
167
        MONTH=`echo ${DATE} | awk 'BEGIN { FS="/"} {print $2; }'`
 
168
        DAY=`echo ${DATE} | awk 'BEGIN { FS="/"} {print $3; }'`
 
169
        if [ "${YEAR}" -gt "2002" ]; then
 
170
                EDITMAP="no"
 
171
        else
 
172
                if [ "${YEAR}" -eq "2002" ]; then
 
173
                        if [ "${MONTH}" -ge "08" ]; then
 
174
                                EDITMAP="no"
 
175
                        fi
 
176
                fi
 
177
        fi
 
178
    fi
 
179
    if [ "x${EDITMAP}" = "xyes" ]; then
 
180
        # Remove any hotplug refs this hairy way
 
181
        grep ^'[^n][^o][^m][^a][^d][^j][^u][^k][^e][^b][^o][^x]' /etc/hotplug/usb.usermap > /tmp/gnomad2.tmp
 
182
        mv /tmp/gnomad2.tmp /etc/hotplug/usb.usermap
 
183
        echo "Removed jukebox entries from usb.usermap."
 
184
    else
 
185
        # echo "No need to remove any usb.usermap entries."
 
186
    fi
 
187
fi
 
188
 
 
189
 
 
190
%clean
 
191
rm -rf $RPM_BUILD_ROOT
 
192
 
 
193
%files
 
194
%defattr(-,root,root)
 
195
%{_bindir}/gnomad2
 
196
%{_datadir}/applications/gnomad2.desktop
 
197
%{_datadir}/locale/*/LC_MESSAGES/gnomad2.mo
 
198
%{_datadir}/application-registry/gnomad2.applications
 
199
%{_datadir}/pixmaps/gnomad2-logo.png
 
200
%dir /etc/hotplug/usb
 
201
%config(noreplace) /etc/hotplug/usb/*
 
202
%doc AUTHORS NEWS README COPYING
 
203
 
 
204
%changelog
 
205
* Wed Sep 29 2004 Linus Walleij <triad@df.lth.se> 2.5.0-1
 
206
- Lots of cool features, libnjb 1.2 CVS version needed
 
207
* Thu Apr 29 2004 Linus Walleij <triad@df.lth.se> 2.4.4-1
 
208
- Bug fixes, compilation on Gnome 2.5/2.6, libnjb 1.1
 
209
* Sat Apr 10 2004 Linus Walleij <triad@df.lth.se> 2.4.3-1
 
210
- Minor bug fixes, syncing up with some libnjb fixes.
 
211
* Mon Feb 22 2004 Linus Walleij <triad@df.lth.se> 2.4.2-1
 
212
- Minor bug fixes, syncing up with some libnjb fixes.
 
213
* Thu Jan 22 2004 Linus Walleij <triad@df.lth.se> 2.4.1-1
 
214
- Bug fixes, mainly NJB1 works again :-)
 
215
* Sat Jan 10 2004 Linus Walleij <triad@df.lth.se> 2.4.0-1
 
216
- Dell Digital Jukebox support, and syncs with CVS libnjb.
 
217
* Sat Dec 06 2003 Linus Walleij <triad@df.lth.se> 2.3.0-1
 
218
- Nomad Zen Xtra support, and sync to libnjb 1.0
 
219
* Mon Oct 27 2003 Linus Walleij <triad@df.lth.se> 2.2.0-1
 
220
- Nomad Zen NX support and full GTK+-2.0 migration.
 
221
* Sun Aug 10 2003 Linus Walleij <triad@df.lth.se> 2.1.0-2
 
222
- Relinking with updated version of libnjb.
 
223
* Sun Aug 10 2003 Linus Walleij <triad@df.lth.se> 2.1.0-1
 
224
- Several enhancements including stuff in libnjb.
 
225
* Thu May 22 2003 Linus Walleij <triad@df.lth.se> 2.0.2-1
 
226
- Making an RPM with minor bug fixes and some upgrade libnjb code.
 
227
* Sun Apr 20 2003 Linus Walleij <triad@df.lth.se> 2.0.1-2_rh9
 
228
- Fixing up a clean and working post script for the hotplugging
 
229
* Sat Apr 19 2003 Linus Walleij <triad@df.lth.se> 2.0.1-1_rh9
 
230
- Creating a RedHat 9 special, adding automated hotplug installation.
 
231
* Sun Mar 30 2003 Linus Walleij <triad@df.lth.se> 2.0.1
 
232
- Some fixes. Still relying on CVS version of libnjb.
 
233
* Thu Jan 16 2003 Linus Walleij <triad@df.lth.se> 2.0.0
 
234
- Skipped alpha. Going to sharp.
 
235
* Sun Jan 12 2003 Linus Walleij <triad@df.lth.se> 2.0.0a-1
 
236
- Initial alpha release of 2.0.0
 
237
* Mon Oct 07 2002 Linus Walleij <triad@df.lth.se> 1.1.6-1
 
238
- Bugfixes and preliminary NJB3 support
 
239
* Sat Sep 07 2002 Linus Walleij <triad@df.lth.se> 1.1.5-1
 
240
- Bugfixes again
 
241
* Fri Jul 19 2002 Linus Walleij <triad@df.lth.se> 1.1.4-1
 
242
- Bugfix release
 
243
* Tue Jun 18 2002 Linus Walleij <triad@df.lth.se> 1.1.3-1
 
244
- Bugfix release
 
245
* Sat Jun 1 2002 Linus Walleij <triad@df.lth.se> 1.1.2-1
 
246
- Another packaging.
 
247
* Sat Apr 6 2002 Linus Walleij <triad@df.lth.se> 1.1.0-1
 
248
- First try at a GNOMAD RPM package.