PDA

View Full Version : [SOLVED] Need help with RPM spec file


Hlingler
18th January 2011, 03:08 AM
OK, I give: what's wrong with the attached spec file? It keeps erroring out.

Thanks,
V

EDIT: revised (but still borked) spec file attached...

leigh123linux
18th January 2011, 05:08 AM
Try


Name: pcgen
Version: 5.16.4
Release: 1%{?dist}
Summary: PCGen is a Java-based RPG character generator and maintenance program
Group:` Applications/Games
License: GNU Library or Lesser General Public License (LGPL)
URL: http://www.pcgen.org
Source0: http://sourceforge.net/projects/pcgen/files/PCGen%20Stable/5.16.4/pcgen5164_full.zip
#Source1: rpmme-pcgen.desktop
Requires: jre >= 1.6.0
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)


%description
PCGen is a Java-based RPG character generator and maintenance program (d20 Systems mainly)
that works on most personal computers (Windows, Mac OS X, Linux, etc.).
All datafiles are ASCII so they can be modified by users.
All of this work is performed under the watchful gaze of the PCGen Board Of Directors.

%prep
%setup -q -n %{name}5164

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/pcgen5164
cp -Rp * ${RPM_BUILD_ROOT}%{_datadir}/pcgen5164
mkdir -p ${RPM_BUILD_ROOT}%{_bindir}
ln -sf pcgen.sh ${RPM_BUILD_ROOT}%{_bindir}/pcgen.sh

# Create the desktop file
# In a different dir to prevent confusion with the exes
%{__cat} > ./rpmme-%{name}.desktop << EOF
[Desktop Entry]
Name=PCGen
Comment=PCGen is a Java-based RPG character generator and maintenance program
Icon=/usr/share/pcgen5164/system/sponsors/pcgen/pcgen_128x128.png
Exec=sh /usr/bin/pcgen
StartupNotify=true
Terminal=false
Type=Application
Categories=Applications;Games
EOF

mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/applications/
install -D -p -m644 ./rpmme-%{name}.desktop ${RPM_BUILD_ROOT}%{_datadir}/applications/

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%{_datadir}/pcgen5164/*
%{_bindir}/pcgen.sh
%{_datadir}/applications/*



%changelog
* Mon Jan 17 2011 VJSchiavoni <hlingler@yahoo.com> - 5.16.4-1
- Initial release.

Hlingler
18th January 2011, 06:06 AM
Yes, that seems to do it (with some other minor edits). Thanks. I knew it would be something relatively easy that I overlooked... but the expert comes to the rescue!

V

EDIT: For posterity, here's the final:Name: pcgen
Version: 5.16.4
Release: 1
Summary: PCGen is a Java-based RPG character generator and maintenance program
Group: Applications/Games
License: GNU Library or Lesser General Public License (LGPL)
URL: http://www.pcgen.org
Source0: http://sourceforge.net/projects/pcgen/files/PCGen%20Stable/5.16.4/pcgen5164_full.zip
#Source1: rpmme-pcgen.desktop
Requires: jre >= 1.6.0
Requires: desktop-file-utils
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)


%description
PCGen is a Java-based RPG character generator and maintenance program (d20 Systems mainly)
that works on most personal computers (Windows, Mac OS X, Linux, etc.).
All datafiles are ASCII so they can be modified by users.
All of this work is performed under the watchful gaze of the PCGen Board Of Directors.

%prep
%setup -q -n %{name}5164

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/pcgen5164
cp -Rp * ${RPM_BUILD_ROOT}%{_datadir}/pcgen5164

# Create the desktop file
# In a different dir to prevent confusion with the exes
%{__cat} > ./rpmme-%{name}.desktop << EOF
[Desktop Entry]
Encoding=UTF-8
Name=PCGen
Comment=PCGen is a Java-based RPG character generator and maintenance program
Icon=/usr/share/pcgen5164/system/sponsors/pcgen/pcgen_128x128.png
Exec=sh /usr/share/pcgen5164/pcgen.sh
StartupNotify=true
Terminal=false
Type=Application
Categories=Application;Game;X-Fedora
EOF

mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/applications/
install -D -p -m644 ./rpmme-%name.desktop ${RPM_BUILD_ROOT}%{_datadir}/applications/

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%{_datadir}/pcgen5164/*
%{_datadir}/applications/*

%post
update-desktop-database %{_datadir}/applications > /dev/null 2>&1 || :

%changelog
* Mon Jan 17 2011 VJSchiavoni <hlingler@yahoo.com> - 5.16.4-1
- Initial release.

RahulSundaram
18th January 2011, 11:24 AM
Hi

You can drop buildroot definition and the clean section entirely. Recent RPM versions ignore those

Kuching Travel Photos - Brasilia Travel Photos - Fukuoka-shi Travel Photos -