Re: Sample files

3 views
Skip to first unread message

Ramboz Pierre-Henri

unread,
Aug 29, 2008, 2:16:42 PM8/29/08
to pclinux...@googlegroups.com
hi all :

here is an inline explanation on how to localize a spec file to have a locale compliant rpm :

the next lines will depict the process using geneweb's spec as a factual example. i've highlighted the parts that are related to i18n. its pretty self explanatory but you may ask if you need some more info about that.

DidouPh

%define name    geneweb
%define version 5.01
%define release %mkrel 2

Summary:    Genealogy software with a Web interface
Summary(de): eine genealogische Software mit einem Web-Interface
Summary(fr): un logiciel de généalogie doté d'une interface Web
Summary(nl): een genealogisch programma met een www-interface
Summary(se): ett genealogi program med ett webbinterface
Name:        %{name}
Version:    %{version}
Release:    %{release}
Copyright:    GPL
#Vendor:        INRIA
Group:        Applications
Source0:        %{name}-%{version}.tgz
Source1:        geneweb.png
Source2:        genealogy.png
URL: http://cristal.inria.fr/~ddr/GeneWeb/
Packager: DidouPh <did...@gmail.com>
BuildRequires: camlp5 glibc gcc-c++
Requires: camlp5 glibc

BuildRoot:     %{_tmppath}/%{name}-%{version}-buildroot

%description
GeneWeb is a genealogy software with a Web interface. It can be used
off-line or as a Web service.

%description -l de
GeneWeb ist eine genealogische Software mit einem Web-Interface.
Sie kann off-line oder als ein Web-Service genutzt werden.

%description -l fr
GeneWeb est un logiciel de généalogie doté d'une interface Web. Il
peut être utilisé non connecté au réseau ou comme un service Web.

%description -l nl
GeneWeb is een genealogisch programma met een www-interface, dat kan
gebruikt worden op computers met of zonder permanente verbinding met
het Internet.

%description -l se
GeneWeb är ett genealogi program med ett webbinterface. Det kan användas
nedkopplad eller som en webbtjänst.

%prep
rm -rf %{buildroot}

%setup -q
./configure --prefix=%{_prefix}

%build
make opt
make distrib

%install
mkdir -p %{buildroot}/home/geneweb
mkdir -p %{buildroot}/etc/rc.d/init.d
mkdir -p %{buildroot}/etc/logrotate.d
mkdir -p %{buildroot}/%{_datadir}/icons
mkdir -p %{buildroot}/%{_datadir}/pixmaps/
cp -r distribution %{buildroot}/home/geneweb/gw
cp rpm/geneweb-initrc.sh %{buildroot}/etc/rc.d/init.d/gwd
cp rpm/geneweb-logrotate %{buildroot}/etc/logrotate.d/gwd
cp %{SOURCE1} %{buildroot}/%{_datadir}/icons/%{name}.png

#xdg menu category
install -d -m755 %{buildroot}/%{_sysconfdir}/xdg/menus/applications-merged
cat > %{buildroot}/%{_sysconfdir}/xdg/menus/applications-merged/genealogy.menu <<EOF
<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"
"http://www.freedesktop.org/standards/menu-spec/menu-1.0.dtd">
<Menu>
    <Name>Applications</Name>
    <Menu>
          <Name>Office</Name>
          <Menu>
              <Name>Genealogy</Name>
              <Directory>genealogy.directory</Directory>
                  <Include>
                      <Category>X-PCLinuxOS-Office-Genealogy</Category>
                  </Include>
          </Menu>
    </Menu>
</Menu>

EOF

#xdg menu category dir
install -D -m 0644 %{SOURCE2} %{buildroot}/%{_datadir}/pixmaps/
install -d -m755 %{buildroot}/%{_datadir}/desktop-directories
cat > %{buildroot}/%{_datadir}/desktop-directories/genealogy.directory <<EOF
[Desktop Entry]
Encoding=UTF-8
Name=Genealogy
Name[fr]=Généalogie
Icon=genealogy.png
Type=Directory
EOF

#desktop-file-install \
#   --vendor="" \
#   --dir %{buildroot}/%{_datadir}/desktop-directories \
#   %{buildroot}/%{_datadir}/desktop-directories/genealogy.directory
  
# creating desktop entry
mkdir -p %{buildroot}/%{_datadir}/applications
cat > %{buildroot}/%{_datadir}/applications/%{name}.desktop <<EOF
[Desktop Entry]
Categories=Office;Database;KDE;X-PCLinuxOS-Office-Genealogy;
Comment=Genealogy software / Web interface
Comment[fr]=Logiciel de Genealogie / Interface Web
Encoding=UTF-8
Exec=konqueror http://localhost:2316/
GenericName=Genealogy Server
GenericName[fr]=Serveur de Genealogie
Icon=geneweb.png
Name=geneweb
StartupNotify=true
Terminal=false
Type=Application
URL=konqueror http://localhost:2316/
Version=1.0
X-KDE-SubstituteUID=false
EOF

# adding menu entry
desktop-file-install \
   --vendor="" \
   --add-category="X-PCLinuxOS-Office-Genealogy"\
   --dir %{buildroot}/%{_datadir}/applications \
   %{buildroot}/%{_datadir}/applications/%{name}.desktop
  
%clean
make clean
rm -rf $RPM_BUILD_ROOT

%pre
/usr/sbin/groupadd geneweb || :
/usr/sbin/useradd -d /home/geneweb -g geneweb -c "GeneWeb database" geneweb || :
chmod a+rx /home/geneweb

%post
%{update_desktop_database}
%{update_menus}
/sbin/ldconfig
chown -R geneweb.geneweb /home/geneweb/gw
chkconfig --add gwd
/etc/rc.d/init.d/gwd start

%preun
/etc/rc.d/init.d/gwd stop
chkconfig --del gwd
rm -f /etc/init.d/gwd

%postun
/sbin/ldconfig
%{clean_menus}
# cd /home/geneweb/gw/gw
# rm -rf doc etc images lang setup gwtp_tmp

%files
%defattr(-,geneweb,geneweb)
%attr(6750, geneweb, geneweb) /home/geneweb/gw/gw/gwd
%attr(6750, geneweb, geneweb) /home/geneweb/gw/gw/gwsetup
%attr(6750, geneweb, geneweb) /home/geneweb/gw/gw/ged2gwb
%attr(6750, geneweb, geneweb) /home/geneweb/gw/gw/gwb2ged
%attr(6750, geneweb, geneweb) /home/geneweb/gw/gw/gwc
%attr(6750, geneweb, geneweb) /home/geneweb/gw/gw/gwu
%attr(6750, geneweb, geneweb) /home/geneweb/gw/gw/consang
%attr(6750, geneweb, geneweb) /home/geneweb/gw/gw/gwtp_tmp/gwtp
%attr(755, root, root) /etc/rc.d/init.d/gwd
%attr(644, root, root) /etc/logrotate.d/gwd
/home/geneweb/gw/*
%defattr(-,root,root)
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/%{name}.png
%doc doc/*
%{_sysconfdir}/xdg/menus/applications-merged/genealogy.menu
%{_datadir}/desktop-directories/genealogy.directory
%{_datadir}/pixmaps/genealogy.png

%changelog
* Sun May 18 2008 DidouPh <did...@matoilnet.com> 5.01
- corrected some minor error
- added i18n content

* Thu Jan 22 2008 DidouPh <did...@gmail.com> 5.01
- ported to pclinuxos

* Sat Nov 10 2000 Daniel de Rauglaudre
- Used chkconfig (Eddie Bindt's hint)

* Thu Nov  9 2000 Ludovic Ledieu
- Simplified files list (a directory includes its contents). It's thus easier
  to maintain the list.
- Removed doc in /usr/doc/geneweb-<version>

* Tue Nov  7 2000 Daniel de Rauglaudre
Version 3.10
- No more installation of geneweb-initrc.sh in SOURCES: it is directly
  copied from BUILD/geneweb-xx/rpm. In that file, added -log for gwd and
  gwsetup.
- Added /etc/logrotate.d/gwd

* Sun Apr  9 2000 Daniel de Rauglaudre
Version 3.03-2
- added set user id bit also for gwc gwu ged2gwb gwb2ged consang because
  were not launched as geneweb user (seemed to depend on the Linux version)

* Tue Dec  7 1999 Daniel de Rauglaudre
Version 3.01
- updated the file list

* Mon Oct  4 1999 Daniel de Rauglaudre
Version 2.07-2
- added RPM_BUILD_ROOT to install the package in /tmp

* Sun Sep 6 1999 Daniel de Rauglaudre
Version 2.06-5
- updated file list

* Sun Sep 5 1999 Daniel de Rauglaudre
Version 2.06-4
Deleted option -r in useradd (Redhat specific)

* Sat Aug 14 1999 Dan Kegel <da...@alumni.caltech.edu>
Created.




Alessio Adamo

unread,
Aug 29, 2008, 2:55:48 PM8/29/08
to pclinux...@googlegroups.com
It's a shame the only way to update them is to rebuild the rpm from source... Am I wrong?

By the way, I will add the how-to to the wiki.

2008/8/29 Ramboz Pierre-Henri <did...@gmail.com>

Ramboz Pierre-Henri

unread,
Aug 29, 2008, 5:54:04 PM8/29/08
to pclinux...@googlegroups.com
you only need to send your edits to the dev of the software, who is listed at the end or at the "Packager" variable ... so yes its a shame but cool its a shame ... for if we provide translation, its piece of cake to issu a "rpm -ba whatever.spec" and just upload it to the pass server !

DidouPh

2008/8/29 Alessio Adamo <alessi...@gmail.com>

Gianvacca

unread,
Sep 10, 2008, 11:47:05 AM9/10/08
to pclinuxos-i18n
Didouph, is there a way to block any spam and use this wiki instead of
the other? The code wiki is impossible to format decently. I really
don't like it.

On 29 Ago, 23:54, "Ramboz Pierre-Henri" <dido...@gmail.com> wrote:
> you only need to send your edits to the dev of the software, who is listed
> at the end or at the "Packager" variable ... so yes its a shame but cool its
> a shame ... for if we provide translation, its piece of cake to issu a "rpm
> -ba whatever.spec" and just upload it to the pass server !
>
> DidouPh
>
> 2008/8/29 Alessio Adamo <alessio.ad...@gmail.com>
>
> > It's a shame the only way to update them is to rebuild the rpm from
> > source... Am I wrong?
>
> > By the way, I will add the how-to to the wiki.
>
> > 2008/8/29 Ramboz Pierre-Henri <dido...@gmail.com>
>
> > hi all :
>
> >> here is an inline explanation on how to localize a spec file to have a
> >> locale compliant rpm :
>
> >> the next lines will depict the process using geneweb's spec as a factual
> >> example. i've highlighted the parts that are related to i18n. its pretty
> >> self explanatory but you may ask if you need some more info about that.
>
> >> DidouPh
>
> >> *%define name    geneweb
> >> %define version 5.01
> >> %define release %mkrel 2
>
> >> Summary:    Genealogy software with a Web interface
> >> Summary(de): eine genealogische Software mit einem Web-Interface
> >> Summary(fr): un logiciel de généalogie doté d'une interface Web
> >> Summary(nl): een genealogisch programma met een www-interface
> >> Summary(se): ett genealogi program med ett webbinterface
> >> Name:        %{name}
> >> Version:    %{version}
> >> Release:    %{release}
> >> Copyright:    GPL
> >> #Vendor:        INRIA
> >> Group:        Applications
> >> Source0:        %{name}-%{version}.tgz
> >> Source1:        geneweb.png
> >> Source2:        genealogy.png
> >> URL:http://cristal.inria.fr/~ddr/GeneWeb/<http://cristal.inria.fr/%7Eddr/GeneWeb/>
> >> Packager: DidouPh <dido...@gmail.com>
> >> Exec=konquerorhttp://localhost:2316/
> >> GenericName=Genealogy Server
> >> GenericName[fr]=Serveur de Genealogie
> >> Icon=geneweb.png
> >> Name=geneweb
> >> StartupNotify=true
> >> Terminal=false
> >> Type=Application
> >> URL=konquerorhttp://localhost:2316/
> >> * Sun May 18 2008 DidouPh <dido...@matoilnet.com> 5.01
> >> - corrected some minor error
> >> - added i18n content
>
> >> * Thu Jan 22 2008 DidouPh <dido...@gmail.com> 5.01
> >> * Sat Aug 14 1999 Dan Kegel <d...@alumni.caltech.edu>
> >> Created.*

Ramboz Pierre-Henri

unread,
Sep 10, 2008, 12:30:05 PM9/10/08
to pclinux...@googlegroups.com
none that i know.


Pierre-Henri Ramboz
9 rue de la monnaie
37000 tours
0678025315

Le 10 sept. 08 à 17:47, Gianvacca <alessi...@gmail.com> a écrit :
Reply all
Reply to author
Forward
0 new messages