Author Topic: [PACKAGED] libunibreak - Is it OK?  (Read 550 times)

Offline sling-shot

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1730
  • Satyameva Jayate | Truth Alone Triumphs.
[PACKAGED] libunibreak - Is it OK?
« on: March 08, 2013, 10:08:53 AM »
<<<<<<<<<<<< Look down below for the final links >>>>>>>>>>>>>

----------------
http://vimgadgets.sourceforge.net/libunibreak/
----------------

libunibreak
------------
Libunibreak is the successor of liblinebreak. Yongwei Wu wrote the original liblinebreak code according to Unicode 6.0.0 Standard Annex 14, Revision 26, and Tom Hacohen added the implementation of the word breaking algorithm according to Unicode 6.0.0 Standard Annex 29, Revision 17. It is designed to be used in a generic text renderer. FBReader is one real-world example, and you may also check some simple sample code, like showbreak and breaktext.
-----------
I was actually looking to update FBReader which depends on this.
-----------

CURRENT PROBLEM: Although the %files section references these files, the build fails telling me that those files are installed but not packaged.
(It could be something very silly that I am missing like a typo in a previous package of bootchart)

Code: [Select]
%files
%defattr(-,root,root)
%doc AUTHORS ChangeLog LICENSE README
/usr/lib/libunibreak.so.1
/usr/lib/libunibreak.so.1.0.0

%files
%defattr(-,root,root)
%exclude %{_libdir}/liblinebreak.a
%exclude %{_libdir}/libunibreak.la
%{_includedir}/*break*.h
%{_libdir}/libunibreak.so
%{_libdir}/pkgconfig/libunibreak.pc

log
Code: [Select]
Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/testinstall/src/rpm/BUILDROOT/libunibreak-1.0-1slingshot2013.i386
error: Installed (but unpackaged) file(s) found:
   /usr/lib/libunibreak.so.1
   /usr/lib/libunibreak.so.1.0.0


RPM build errors:
    Installed (but unpackaged) file(s) found:
   /usr/lib/libunibreak.so.1
   /usr/lib/libunibreak.so.1.0.0

« Last Edit: March 18, 2013, 11:03:49 AM by sling-shot »
Packaging well will cure headaches of many :) But learning to package will cause headaches in many :(

AMD AthlonX2 3600+/ASUS M2NPV-VM/ATi HD4670/Onboard sound/3.5GB DDR2-533 RAM/SEAGATE 160+320GB HDD/DELL S2240L FullHD/Creative SBS370 2.1/PCLinuxOS2013/KDE4
Samsung NP305U1-A06IN | Nokia E6

Offline sling-shot

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1730
  • Satyameva Jayate | Truth Alone Triumphs.
Looks like I spoke too soon.

I found out that I forgot to add "devel" after the second %files :(

Now it builds with no errors.

« Last Edit: March 18, 2013, 11:06:03 AM by sling-shot »
Packaging well will cure headaches of many :) But learning to package will cause headaches in many :(

AMD AthlonX2 3600+/ASUS M2NPV-VM/ATi HD4670/Onboard sound/3.5GB DDR2-533 RAM/SEAGATE 160+320GB HDD/DELL S2240L FullHD/Creative SBS370 2.1/PCLinuxOS2013/KDE4
Samsung NP305U1-A06IN | Nokia E6

Offline ghostbunny

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1157
Re: [SOLVED] Unable to get rid of "Installed but unpackaged files"
« Reply #2 on: March 08, 2013, 01:06:31 PM »
Hi sling-shot,

the spec looks ok, except the naming.

The convention for libraries is to use the %mklibname macro for generating the name to get correct lib64 packages on 64bit.

further more if you have a library package it is suggested to run ldconfig on package install or uninstall.

to avoid editing the files section when a api update appears we usually define a major macro and use this for the library name in the files section of the normal lib package.

my suggestion for the spec:

Code: [Select]
%define libname %mklibname unibreak
%define libdevname %mklibname unibreak -d
%define major 1

Name: libunibreak
Version: 1.0
Release: %mkrel 1
Summary: An implementation of the line breaking and word breaking algorithms
License: zlib/libpng licence
Group: System/Libraries
URL: http://vimgadgets.sourceforge.net/libunibreak/
Source: %{name}-%{version}.tar.xz
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot

%description
libunibreak, an implementation of the line
breaking and word breaking algorithms as described in Unicode
Standard Annex 14 and Unicode Standard Annex 29, available at
         <URL:http://www.unicode.org/reports/tr14/tr14-26.html>
         <URL:http://www.unicode.org/reports/tr29/tr29-17.html>

Check this URL for up-to-date information:
         <URL:http://vimgadgets.sourceforge.net/libunibreak/>

%package -n %{libname}
Summary: An implementation of the line breaking and word breaking algorithms
Group: System/Libraries

%description -n %{libname}
libunibreak, an implementation of the line
breaking and word breaking algorithms as described in Unicode
Standard Annex 14 and Unicode Standard Annex 29, available at
         <URL:http://www.unicode.org/reports/tr14/tr14-26.html>
         <URL:http://www.unicode.org/reports/tr29/tr29-17.html>

Check this URL for up-to-date information:
         <URL:http://vimgadgets.sourceforge.net/libunibreak/>

%package -n %{libdevname}
Summary: Devel package of %{name}
Group: System/Libraries
Requires: %{name} = %{version}-%{release}
Provides: %{name}-devel = %{version}-%{release}

%description -n %{libdevname}
Devel package of %{name}

%prep
%setup -q

%build
%configure2_5x --disable-static
%make

%install
rm -rf %buildroot

%makeinstall

%post -n %{libname}
/sbin/ldconfig

%postun -n %{libname}
/sbin/ldconfig

%clean
rm -rf $RPM_BUILD_ROOT

%files -n %{libname}
%defattr(-,root,root)
%doc AUTHORS ChangeLog LICENCE README
%{_libdir}/libunibreak.so.%{major}*

%files -n %{libdevname}
%defattr(-,root,root)
%exclude %{_libdir}/liblinebreak.a
%exclude %{_libdir}/libunibreak.la
%{_includedir}/*break*.h
%{_libdir}/libunibreak.so
%{_libdir}/pkgconfig/libunibreak.pc

%changelog
* Tue Mar 05 2013 Sling Shot <sling-shot at lycos.com>
- Initial package at 1.0

regads
ghostbunny
The full life is a big mess

PS:
I'm German. Sorry because of possible mistakes in my written messages xD


Offline sling-shot

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1730
  • Satyameva Jayate | Truth Alone Triumphs.
Re: [SOLVED] Unable to get rid of "Installed but unpackaged files"
« Reply #3 on: March 14, 2013, 11:49:35 AM »
I have to report a problem with your .spec.

I wanted to setup and check this on a 64 bit system too so I got delayed.

First I gave it a try on 64 bit. It worked and produced lib64unibreak.
When I come back to 32 bit environment and try the same .spec file, I get this error:
Code: [Select]
error: Package already exists: %package -n libunibreak

Packaging well will cure headaches of many :) But learning to package will cause headaches in many :(

AMD AthlonX2 3600+/ASUS M2NPV-VM/ATi HD4670/Onboard sound/3.5GB DDR2-533 RAM/SEAGATE 160+320GB HDD/DELL S2240L FullHD/Creative SBS370 2.1/PCLinuxOS2013/KDE4
Samsung NP305U1-A06IN | Nokia E6

Offline ghostbunny

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1157
Re: [SOLVED] Unable to get rid of "Installed but unpackaged files"
« Reply #4 on: March 14, 2013, 02:27:30 PM »
That's possible i wrote the extensions out of mind if i remember correctly but it is possible to avoid this error by adding the major number to the libname macros

Code: [Select]
%define major 1
%define libname %mklibname unibreak %{major}
%define libdevname %mklibname unibreak -d

regards
ghostbunny
The full life is a big mess

PS:
I'm German. Sorry because of possible mistakes in my written messages xD


Offline sling-shot

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1730
  • Satyameva Jayate | Truth Alone Triumphs.
Packaging well will cure headaches of many :) But learning to package will cause headaches in many :(

AMD AthlonX2 3600+/ASUS M2NPV-VM/ATi HD4670/Onboard sound/3.5GB DDR2-533 RAM/SEAGATE 160+320GB HDD/DELL S2240L FullHD/Creative SBS370 2.1/PCLinuxOS2013/KDE4
Samsung NP305U1-A06IN | Nokia E6

Offline ghostbunny

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1157
Re: [PACKAGED] libunibreak - Is it OK?
« Reply #6 on: March 18, 2013, 12:57:34 PM »
Does the installation of the devel package work on 64bit?
The full life is a big mess

PS:
I'm German. Sorry because of possible mistakes in my written messages xD


Offline sling-shot

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1730
  • Satyameva Jayate | Truth Alone Triumphs.
Re: [PACKAGED] libunibreak - Is it OK?
« Reply #7 on: March 19, 2013, 09:58:40 AM »
Yep it seems to install alright in my 64 bit partition.

However, the devel file does not pull the main package. (Usually I find that devel packages pull their respective main packages)
Packaging well will cure headaches of many :) But learning to package will cause headaches in many :(

AMD AthlonX2 3600+/ASUS M2NPV-VM/ATi HD4670/Onboard sound/3.5GB DDR2-533 RAM/SEAGATE 160+320GB HDD/DELL S2240L FullHD/Creative SBS370 2.1/PCLinuxOS2013/KDE4
Samsung NP305U1-A06IN | Nokia E6

Offline ghostbunny

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1157
Re: [PACKAGED] libunibreak - Is it OK?
« Reply #8 on: March 19, 2013, 10:36:46 AM »
the normal lib package should have a

Code: [Select]
Provides: %{name} = %{version}-%{release}
when you have a

Code: [Select]
Requires: %{name} = %{version}-%{release}in the devel package
The full life is a big mess

PS:
I'm German. Sorry because of possible mistakes in my written messages xD


Offline sling-shot

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1730
  • Satyameva Jayate | Truth Alone Triumphs.
Re: [PACKAGED] libunibreak - Is it OK?
« Reply #9 on: March 19, 2013, 01:24:28 PM »
Is that a hard and fast rule or is it OK as it is now?
Packaging well will cure headaches of many :) But learning to package will cause headaches in many :(

AMD AthlonX2 3600+/ASUS M2NPV-VM/ATi HD4670/Onboard sound/3.5GB DDR2-533 RAM/SEAGATE 160+320GB HDD/DELL S2240L FullHD/Creative SBS370 2.1/PCLinuxOS2013/KDE4
Samsung NP305U1-A06IN | Nokia E6

Offline TerryN

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 723
Re: [PACKAGED] libunibreak - Is it OK?
« Reply #10 on: March 19, 2013, 01:57:10 PM »
Is that a hard and fast rule or is it OK as it is now?

The -devel package should ensure that the run-time library is installed.

Code: [Select]
[root@dell Downloads]# apt-get install libunibreak-devel
Reading Package Lists... Done
Building Dependency Tree... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or that some of the repositories
in use are in an inconsistent state at the moment.

Since you only requested a single operation it is extremely likely that
the package is simply not installable and a bug report against
that package should be filed.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
  libunibreak-devel: Depends: libunibreak (= 1.0-1slingshot2013) but it is not installable
E: Broken packages

You still need to sort the names out  ;)

Terry
Dell E521 - AMD 64 X2 5000+, 4GB RAM, ATI X1300 graphics
PCLinuxOS 2013 (KDE)
|Twitter|

Offline sling-shot

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1730
  • Satyameva Jayate | Truth Alone Triumphs.
Re: [PACKAGED] libunibreak - Is it OK?
« Reply #11 on: March 21, 2013, 10:54:31 AM »
TerryN,
I am putting this suggestion with much hesitation. ??? I have tried installing the -devel after removing both packages from my existing installation and it seems to install fine here on both 32 bit and 64 bit installations. Am I missing something else here?
I did the following:
- Put both libunibreakxxxx.rpm and libunibreak-develxxxx.rpm in the same directory.
- Ran apt-get install libunibreak*.rpm as su.
Packaging well will cure headaches of many :) But learning to package will cause headaches in many :(

AMD AthlonX2 3600+/ASUS M2NPV-VM/ATi HD4670/Onboard sound/3.5GB DDR2-533 RAM/SEAGATE 160+320GB HDD/DELL S2240L FullHD/Creative SBS370 2.1/PCLinuxOS2013/KDE4
Samsung NP305U1-A06IN | Nokia E6

Offline TerryN

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 723
Re: [PACKAGED] libunibreak - Is it OK?
« Reply #12 on: March 21, 2013, 10:59:35 AM »
From your build log:

Quote
Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/testinstall/src/rpm/BUILDROOT/libunibreak-1.0-1slingshot2013.i386
Wrote: /home/testinstall/src/rpm/SRPMS/libunibreak-1.0-1slingshot2013.src.rpm
Wrote: /home/testinstall/src/rpm/RPMS/i586/libunibreak1-1.0-1slingshot2013.i586.rpm
Wrote: /home/testinstall/src/rpm/RPMS/i586/libunibreak-devel-1.0-1slingshot2013.i586.rpm

There is NO libunibreak package (only libunibreak1 and libunibreak-devel).
The -devel package depends on libunibreak.
I have no idea how YOUR system can be resolving a dependency called libunibreak (unless you have a package from a prior build around)
What do you get for:
Code: [Select]
apt-cache whatprovides libunibreak
Terry.
« Last Edit: March 21, 2013, 11:14:40 AM by TerryN »
Dell E521 - AMD 64 X2 5000+, 4GB RAM, ATI X1300 graphics
PCLinuxOS 2013 (KDE)
|Twitter|

Offline sling-shot

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1730
  • Satyameva Jayate | Truth Alone Triumphs.
Re: [PACKAGED] libunibreak - Is it OK?
« Reply #13 on: March 21, 2013, 12:29:12 PM »
There is NO libunibreak package (only libunibreak1 and libunibreak-devel).
The -devel package depends on libunibreak.
I have no idea how YOUR system can be resolving a dependency called libunibreak (unless you have a package from a prior build around)
What do you get for:
Code: [Select]
apt-cache whatprovides libunibreak
Terry.

I get libunibreak-1.0-1slingshot2013 and you caught the miss ;) there!

I had an older libunibreak-1.0 sitting in the i586 directory.

------------

Adding the following to the .spec in the main package section does not solve this problem because apt-cache does not seem to recognize the resulting package as providing libunibreak.
Code: [Select]
Provides: libunibreak

I do not know how to proceed further.

I have compared this .spec to another pclos library .spec of libsamplerate and this seems to be good.

Now what am I missing here?  :o

---------------

Why do we need to have the %description etc twice when it comes to the .spec for a library? Is it not redundant?
Because of the presence of %package reference below the main set I seem to get
Code: [Select]
error: Package already exists: %package -n libunibreakwhen building without %major tagged to the end of libname here.
« Last Edit: March 21, 2013, 12:32:55 PM by sling-shot »
Packaging well will cure headaches of many :) But learning to package will cause headaches in many :(

AMD AthlonX2 3600+/ASUS M2NPV-VM/ATi HD4670/Onboard sound/3.5GB DDR2-533 RAM/SEAGATE 160+320GB HDD/DELL S2240L FullHD/Creative SBS370 2.1/PCLinuxOS2013/KDE4
Samsung NP305U1-A06IN | Nokia E6

Offline sling-shot

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1730
  • Satyameva Jayate | Truth Alone Triumphs.
Re: [PACKAGED] libunibreak - Is it OK?
« Reply #14 on: March 21, 2013, 12:38:50 PM »
OK. This .spec works and the resulting -devel package installs and pulls the main package too on 32 bit. Yet to be tested on 64 bit.
Code: [Select]
%define major 1
%define libname %mklibname unibreak
%define libdevname %mklibname unibreak -d

#define libname %mklibname unibreak
#define libdevname %mklibname unibreak -d
#define major 1

Name: libunibreak
Version: 1.0
Release: %mkrel 1
Summary: An implementation of the line breaking and word breaking algorithms
License: zlib/libpng licence
Group: System/Libraries
URL: http://vimgadgets.sourceforge.net/libunibreak/
Source: %{name}-%{version}.tar.xz
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot

%description
libunibreak, an implementation of the line
breaking and word breaking algorithms as described in Unicode
Standard Annex 14 and Unicode Standard Annex 29, available at
         <URL:http://www.unicode.org/reports/tr14/tr14-26.html>
         <URL:http://www.unicode.org/reports/tr29/tr29-17.html>

Check this URL for up-to-date information:
         <URL:http://vimgadgets.sourceforge.net/libunibreak/>

%package -n %{libdevname}
Summary: Devel package of %{name}
Group: System/Libraries
Requires: %{name} = %{version}-%{release}
Provides: %{name}-devel = %{version}-%{release}

%description -n %{libdevname}
Devel package of %{name}

%prep
%setup -q

%build
%configure2_5x --disable-static
%make

%install
rm -rf %buildroot

%makeinstall

%post -n %{libname}
/sbin/ldconfig

%postun -n %{libname}
/sbin/ldconfig

%clean
rm -rf $RPM_BUILD_ROOT

%files -n %{libname}
%defattr(-,root,root)
%doc AUTHORS ChangeLog LICENCE README
%{_libdir}/libunibreak.so.%{major}*

%files -n %{libdevname}
%defattr(-,root,root)
%exclude %{_libdir}/liblinebreak.a
%exclude %{_libdir}/libunibreak.la
%{_includedir}/*break*.h
%{_libdir}/libunibreak.so
%{_libdir}/pkgconfig/libunibreak.pc

%changelog
* Tue Mar 05 2013 Sling Shot <sling-shot at lycos.com>
- Initial package at 1.0
Packaging well will cure headaches of many :) But learning to package will cause headaches in many :(

AMD AthlonX2 3600+/ASUS M2NPV-VM/ATi HD4670/Onboard sound/3.5GB DDR2-533 RAM/SEAGATE 160+320GB HDD/DELL S2240L FullHD/Creative SBS370 2.1/PCLinuxOS2013/KDE4
Samsung NP305U1-A06IN | Nokia E6