Skip to content

Commit

Permalink
[libmlocale] Change install targets for Qt 5 and add packaging for Qt 5.
Browse files Browse the repository at this point in the history
  • Loading branch information
rburchell committed Apr 10, 2013
1 parent db83a86 commit ce46939
Show file tree
Hide file tree
Showing 11 changed files with 201 additions and 13 deletions.
6 changes: 4 additions & 2 deletions benchmarks/common_top.pri
Expand Up @@ -16,13 +16,15 @@ QT += testlib
TEMPLATE = app
# DEFINES += QT_NO_DEBUG_OUTPUT
DEFINES += UNIT_TEST
target.path = $$[QT_INSTALL_LIBS]/libmlocale-benchmarks
equals(QT_MAJOR_VERSION, 4): target.path = $$[QT_INSTALL_LIBS]/libmlocale-benchmarks
equals(QT_MAJOR_VERSION, 5): target.path = $$[QT_INSTALL_LIBS]/libmlocale-benchmarks5
INSTALLS += target

LIBS += $$mAddLibrary(mlocale)

support_files.files =
support_files.path = $$[QT_INSTALL_LIBS]/libmlocale-benchmarks
equals(QT_MAJOR_VERSION, 4): support_files.path = $$[QT_INSTALL_LIBS]/libmlocale-benchmarks
equals(QT_MAJOR_VERSION, 5): support_files.path = $$[QT_INSTALL_LIBS]/libmlocale-benchmarks5
INSTALLS += support_files

CONFIG-=app_bundle
3 changes: 2 additions & 1 deletion benchmarks/shell.pri
Expand Up @@ -4,7 +4,8 @@ shell_scripts.CONFIG += no_check_exist

include(../mkspecs/common.pri)

shell_scripts.path += $$ML_INSTALL_DATA/libmlocale-benchmarks
equals(QT_MAJOR_VERSION, 4): shell_scripts.path += $$ML_INSTALL_DATA/libmlocale-benchmarks
equals(QT_MAJOR_VERSION, 5): shell_scripts.path += $$ML_INSTALL_DATA/libmlocale-benchmarks5
shell_scripts.depends = FORCE

INSTALLS += \
Expand Down
2 changes: 1 addition & 1 deletion configure
Expand Up @@ -501,7 +501,7 @@ fi

# substitute prefix in .pc files
MEEGOTOUCH_PC_DIR="$outpath/src/data"
MEEGOTOUCH_PC_FILES="mlocale"
MEEGOTOUCH_PC_FILES="mlocale mlocale5"

# make sure the directory exists
if [ ! -d $MEEGOTOUCH_PC_DIR ]; then
Expand Down
9 changes: 6 additions & 3 deletions mkspecs/features/mlocale_defines.prf.in
Expand Up @@ -28,10 +28,13 @@ win32 {
ML_INSTALL_BIN = $$ML_PREFIX/bin
ML_INSTALL_LIBS = $$ML_LIBDIR
ML_INSTALL_DATA = $$ML_PREFIX/share
ML_INSTALL_HEADERS = $$ML_PREFIX/include/mlocale
ML_TRANSLATION_DIR = $$ML_INSTALL_DATA/l10n/mlocale
equals(QT_MAJOR_VERSION, 4): ML_INSTALL_HEADERS = $$ML_PREFIX/include/mlocale
equals(QT_MAJOR_VERSION, 5): ML_INSTALL_HEADERS = $$ML_PREFIX/include/mlocale5
equals(QT_MAJOR_VERSION, 4): ML_TRANSLATION_DIR = $$ML_INSTALL_DATA/l10n/mlocale
equals(QT_MAJOR_VERSION, 5): ML_TRANSLATION_DIR = $$ML_INSTALL_DATA/l10n/mlocale5

unix|win32: ML_ICUEXTRADATA_DIR = $$ML_INSTALL_DATA/mlocale/icu
equals(QT_MAJOR_VERSION, 4): unix|win32: ML_ICUEXTRADATA_DIR = $$ML_INSTALL_DATA/mlocale/icu
equals(QT_MAJOR_VERSION, 5): unix|win32: ML_ICUEXTRADATA_DIR = $$ML_INSTALL_DATA/mlocale5/icu
win32: ML_INSTALL_LIBS = $$ML_PREFIX/bin

defineReplace(mAddLibrary) {
Expand Down
120 changes: 120 additions & 0 deletions rpm/libmlocale5.spec
@@ -0,0 +1,120 @@
#
# Do NOT Edit the Auto-generated Part!
# Generated by: spectacle version 0.25
#

Name: libmlocale5

# >> macros
# << macros

Summary: Contains classes MLocale and friends originally from libmeegotouch
Version: 0.5.0
Release: 1
Group: System/Libraries
License: LGPLv2
URL: https://meego.gitorious.org/meegotouch/libmlocale
Source0: %{name}-%{version}.tar.bz2
Source100: libmlocale5.yaml
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
BuildRequires: pkgconfig(icu-uc)
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Xml)
BuildRequires: pkgconfig(Qt5Test)
BuildRequires: gconf-devel
BuildRequires: qt5-qttools-linguist

%description
Contains classes MLocale and friends originally from libmeegotouch.
With that separation one can use those localization facilities without
having to bring on board also the MeeGo Touch GUI toolkit.


%package devel
Summary: Devel files for limlocale
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}

%description devel
%{summary}.

%package tests
Summary: Tests for limlocale
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}

%description tests
%{summary}.

%package benchmarks
Summary: Benchmarks files for limlocale
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}

%description benchmarks
%{summary}.


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

# >> setup
# << setup

%build
# >> build pre
# << build pre

%configure --disable-static
make %{?jobs:-j%jobs}

# >> build post
# << build post

%install
rm -rf %{buildroot}
# >> install pre
# << install pre
%make_install

# >> install post
# << install post


%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%doc LICENSE.LGPL
%{_libdir}/*.so.*
%{_datadir}/mlocale5/icu
# >> files
# << files

%files devel
%defattr(-,root,root,-)
%{_datadir}/qt5/mkspecs/features/*.prf
%{_libdir}/*.so
%{_libdir}/*.prl
%{_includedir}/mlocale5/*.h
%{_includedir}/mlocale5/M*
%{_libdir}/pkgconfig/*.pc
# >> files devel
# << files devel

%files tests
%defattr(-,root,root,-)
%{_libdir}/libmlocale-tests5
%{_datadir}/libmlocale-tests5/tests.xml
# >> files tests
# << files tests

%files benchmarks
%defattr(-,root,root,-)
%{_libdir}/libmlocale-benchmarks5
%{_datadir}/libmlocale-benchmarks5/tests.xml
# >> files benchmarks
# << files benchmarks
54 changes: 54 additions & 0 deletions rpm/libmlocale5.yaml
@@ -0,0 +1,54 @@
Name: libmlocale5
Summary: Contains classes MLocale and friends originally from libmeegotouch
Release: 1
Description: |
Contains classes MLocale and friends originally from libmeegotouch.
With that separation one can use those localization facilities without
having to bring on board also the MeeGo Touch GUI toolkit.
Version: 0.5.0
URL: https://meego.gitorious.org/meegotouch/libmlocale
Group: System/Libraries
License: LGPLv2
Sources:
- "%{name}-%{version}.tar.bz2"
PkgConfigBR:
- icu-uc
- Qt5Core
- Qt5Xml
- Qt5Test
PkgBR:
- gconf-devel
- qt5-qttools-linguist # lrelease and friends
Files:
- "%doc LICENSE.LGPL"
- "%{_libdir}/*.so.*"
- "%{_datadir}/mlocale5/icu"
SubPackages:
- Name: devel
Summary: Devel files for limlocale
Group: Development/Libraries
Description: "%{summary}."
Files:
- "%{_datadir}/qt5/mkspecs/features/*.prf"
- "%{_libdir}/*.so"
- "%{_libdir}/*.prl"
- "%{_includedir}/mlocale5/*.h"
- "%{_includedir}/mlocale5/M*"
- "%{_libdir}/pkgconfig/*.pc"

- Name: tests
Summary: Tests for limlocale
Group: Development/Libraries
Description: "%{summary}."
Files:
- "%{_libdir}/libmlocale-tests5"
- "%{_datadir}/libmlocale-tests5/tests.xml"

- Name: benchmarks
Summary: Benchmarks files for limlocale
Group: Development/Libraries
Description: "%{summary}."
Files:
- "%{_libdir}/libmlocale-benchmarks5"
- "%{_datadir}/libmlocale-benchmarks5/tests.xml"

6 changes: 4 additions & 2 deletions src/src.pro
Expand Up @@ -5,7 +5,8 @@ DEFINES += M_BUILD_MLOCALE
include(common_top.pri)
QT += xml

TARGET = mlocale
equals(QT_MAJOR_VERSION, 4): TARGET = mlocale
equals(QT_MAJOR_VERSION, 5): TARGET = mlocale5

INCLUDEPATH += .

Expand Down Expand Up @@ -102,7 +103,8 @@ INSTALLS += install_prf

# install pkgconfig file
install_pkgconfig.path = $$ML_INSTALL_LIBS/pkgconfig
install_pkgconfig.files = data/mlocale.pc
equals(QT_MAJOR_VERSION, 4): install_pkgconfig.files = data/mlocale.pc
equals(QT_MAJOR_VERSION, 5): install_pkgconfig.files = data/mlocale5.pc

INSTALLS += install_pkgconfig

Expand Down
6 changes: 4 additions & 2 deletions tests/common_top.pri
Expand Up @@ -19,11 +19,13 @@ QT += testlib
TEMPLATE = app
# DEFINES += QT_NO_DEBUG_OUTPUT
DEFINES += UNIT_TEST
target.path = $$[QT_INSTALL_LIBS]/libmlocale-tests
equals(QT_MAJOR_VERSION, 4): target.path = $$[QT_INSTALL_LIBS]/libmlocale-tests
equals(QT_MAJOR_VERSION, 5): target.path = $$[QT_INSTALL_LIBS]/libmlocale-tests5
INSTALLS += target

LIBS += $$mAddLibrary(mlocale)

support_files.files =
support_files.path = $$[QT_INSTALL_LIBS]/libmlocale-tests
equals(QT_MAJOR_VERSION, 4): support_files.path = $$[QT_INSTALL_LIBS]/libmlocale-tests
equals(QT_MAJOR_VERSION, 5): support_files.path = $$[QT_INSTALL_LIBS]/libmlocale-tests5
INSTALLS += support_files
2 changes: 2 additions & 0 deletions tests/shell.pri
Expand Up @@ -4,6 +4,8 @@ shell_scripts.CONFIG += no_check_exist

include(../mkspecs/common.pri)

equals(QT_MAJOR_VERSION, 4): shell_scripts.path += $$ML_INSTALL_DATA/libmlocale-tests
equals(QT_MAJOR_VERSION, 5): shell_scripts.path += $$ML_INSTALL_DATA/libmlocale-tests5
shell_scripts.path += $$ML_INSTALL_DATA/libmlocale-tests
shell_scripts.depends = FORCE

Expand Down
Expand Up @@ -10,7 +10,8 @@ LANGUAGES = ar_EG en_GB de_DE
CATALOGNAME = ut_translations-qttrid
SOURCEDIR = $$PWD/..
TRANSLATIONDIR = $$PWD
TRANSLATION_INSTALLDIR = $$[QT_INSTALL_LIBS]/libmlocale-tests/translations-qttrid
equals(QT_MAJOR_VERSION, 4): TRANSLATION_INSTALLDIR = $$[QT_INSTALL_LIBS]/libmlocale-tests/translations-qttrid
equals(QT_MAJOR_VERSION, 5): TRANSLATION_INSTALLDIR = $$[QT_INSTALL_LIBS]/libmlocale-tests5/translations-qttrid
# these include files are installed to $$[QT_INSTALL_DATA]/mkspecs/features
# and included in the "libmlocale-dev" package:
include($${M_BUILD_TREE}/mkspecs/features/mlocale_defines.prf)
Expand Down
3 changes: 2 additions & 1 deletion tests/ut_translations/translations-tr/translations-tr.pro
Expand Up @@ -11,7 +11,8 @@ DISABLE_QTTRID_ENGINEERING_ENGLISH = yes
CATALOGNAME = ut_translations-tr
SOURCEDIR = $$PWD/..
TRANSLATIONDIR = $$PWD
TRANSLATION_INSTALLDIR = $$[QT_INSTALL_LIBS]/libmlocale-tests/translations-tr
equals(QT_MAJOR_VERSION, 4): TRANSLATION_INSTALLDIR = $$[QT_INSTALL_LIBS]/libmlocale-tests/translations-tr
equals(QT_MAJOR_VERSION, 5): TRANSLATION_INSTALLDIR = $$[QT_INSTALL_LIBS]/libmlocale-tests5/translations-tr
# add “-verbose” to force without “-idbased” which is the default in translations.pri
LRELEASE_OPTIONS = "-verbose"

Expand Down

0 comments on commit ce46939

Please sign in to comment.