Blob Blame History Raw
Name:           pastebinit
Version:        1.2
Release:        1%{?dist}
Summary:        Send anything you want directly to a pastebin from the command line

Group:          Applications/Internet
License:        GPLv2+
URL:            https://launchpad.net/pastebinit
Source0:        http://launchpad.net/%{name}/trunk/%{version}/+download/%{name}-%{version}.tar.gz

#
# supress useless dependancy to lsb_release, folow the comportement of 
# upstream by using per default fpaste.org.
# this patch musn't be push to the upstream 
#
Patch0:         %{name}-1.2-delete-dependancy-to-lsb_release.patch
BuildArch:      noarch
BuildRequires:  docbook-style-xsl libxslt gettext
Requires:       python-configobj

%description
A software that lets you send anything you want directly to a
pastebin from the command line.  This software lets you send a file
or simply the result of a command directly to the pastebin you want
(if it's supported) and gives you the URL in return.

%prep
%setup -q
%patch0 -p1
# Change the location of pastebin config file from /etc/pastebin.d/
# to /usr/share/pastebinit/ (unappropriate dir. name "pastebinit.d"
# + FHS)
# See https://bugs.launchpad.net/pastebinit/+bug/621923
#
sed -i "s|/etc/pastebin.d|%{_datadir}/%{name}|g" %{name} README
sed -i "s|pastebin.d|%{name}|g" %{name} README

%build
# Generate the man page from docbook xml
xsltproc -''-nonet %{_datadir}/sgml/docbook/xsl-stylesheets*/manpages/docbook.xsl pastebinit.xml 

# Build translation
pushd po
make
popd

%install
rm -rf %{buildroot}

mkdir -p %{buildroot}%{_datadir}/
cp -a pastebin.d %{buildroot}%{_datadir}
rm %{buildroot}%{_datadir}/pastebin.d/yourpaste.net.conf
mv %{buildroot}%{_datadir}/pastebin.d/ %{buildroot}%{_datadir}/%{name}/

install -m 0755 -D -p %{name} %{buildroot}%{_bindir}/%{name}
install -m 0644 -D -p %{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1

# Install translations
pushd po
cp -a mo %{buildroot}%{_datadir}/locale/
popd

%find_lang %{name}

%clean
rm -rf %{buildroot}


%files -f %{name}.lang
%defattr(-,root,root,-)
%{_bindir}/%{name}
%{_mandir}/man1/%{name}.1.*
%{_datadir}/%{name}/
%doc README COPYING 
%doc pastebin.d/yourpaste.net.conf

%changelog
* Tue Feb 08 2011 Lameire Alexis <alexisis-pristontale@hotmail.com> - 1.2-1
- update to 1.2 upstream release
- delete old rafb patchs
- supress dependancy to lsb_release

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Tue Aug 24 2010 Lameire Alexis <alexisis-pristontale@hotmail.com> - 1.1-4
- add forget macro on the xslt procx

* Sun Aug 22 2010 Lameire Alexis <alexisis-pristontale@hotmail.com> - 1.1-3
- add forgotten -i option to the first sed command
- add another sed to patch the user config dir. to a proper name
- move the example conf. file yourpaste.conf to the doc. dir.
- delete BuildRoot key

* Sat Aug 21 2010 Lameire Alexis <alexisis-pristontale@hotmail.com> - 1.1-2
- make owner on the datadir
- patch source file to force config file folow the FHS

* Sun Aug 01 2010 Lameire Alexis <alexisis-pristontale@hotmail.com> - 1.1-1
- initial release