From f4334732da0846c3e73f7bc490fabd807598925b Mon Sep 17 00:00:00 2001 From: Marvin W Date: Thu, 23 Mar 2017 21:44:27 +0100 Subject: RPM + tito + copr support --- .tito/packages/.readme | 3 ++ .tito/tito.props | 5 +++ CMakeLists.txt | 4 +- configure | 7 +-- dino.spec | 115 +++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 129 insertions(+), 5 deletions(-) create mode 100644 .tito/packages/.readme create mode 100644 .tito/tito.props create mode 100644 dino.spec diff --git a/.tito/packages/.readme b/.tito/packages/.readme new file mode 100644 index 00000000..b9411e2d --- /dev/null +++ b/.tito/packages/.readme @@ -0,0 +1,3 @@ +the .tito/packages directory contains metadata files +named after their packages. Each file has the latest tagged +version and the project's relative directory. diff --git a/.tito/tito.props b/.tito/tito.props new file mode 100644 index 00000000..eab3f190 --- /dev/null +++ b/.tito/tito.props @@ -0,0 +1,5 @@ +[buildconfig] +builder = tito.builder.Builder +tagger = tito.tagger.VersionTagger +changelog_do_not_remove_cherrypick = 0 +changelog_format = %s (%ae) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a6eab42..173bed35 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,8 +67,8 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) find_package(Vala 0.30 REQUIRED) -if(VALA_VERSION VERSION_EQUAL "0.36.0") - # Due to a bug on 0.36.0, we need to disable FAST_VAPI +if(VALA_VERSION VERSION_GREATER "0.34.90" AND VALA_VERSION VERSION_LESS "0.36.1") + # Due to a bug on 0.36.0 (and pre-releases), we need to disable FAST_VAPI set(DISABLE_FAST_VAPI yes) endif() diff --git a/configure b/configure index 58293e2e..953649d1 100755 --- a/configure +++ b/configure @@ -59,7 +59,7 @@ done if [ -d ".git" ]; then git submodule update --init 2>/dev/null -elif [ -x $(which git) ]; then +else tmp=0 for i in $(cat .gitmodules | grep -n submodule | awk -F ':' '{print $1}') $(wc -l .gitmodules | awk '{print $1}'); do if ! [ $tmp -eq 0 ]; then @@ -70,7 +70,8 @@ elif [ -x $(which git) ]; then branch=$(echo "$def" | grep '^branch=' | awk -F '=' '{print $2}') if ! ls "$path"/* >/dev/null 2>/dev/null; then - if ! [ -x $(which git) ]; then + git=$(which git) + if ! [ $? -eq 0 ] || ! [ -x $git ]; then echo "Failed retrieving missing files" exit 5 fi @@ -150,7 +151,7 @@ mkdir -p build cd build echo "$cmake_type" > .cmake_type -cmake -G "$cmake_type" -DCMAKE_INSTALL_PREFIX="$PREFIX" -DENABLED_PLUGINS="$ENABLED_PLUGINS" -DDISABLED_PLUGINS="$DISABLED_PLUGINS" -DVALA_EXECUTABLE="$VALA_EXECUTABLE" -DCMAKE_VALA_FLAGS="$VALAC_FLAGS" -DDISABLE_FAST_VAPI="$DISABLE_FAST_VAPI" -DLIB_SUFFIX="$LIB_SUFFIX" -DNO_DEBUG="$NO_DEBUG" .. +cmake -G "$cmake_type" -DCMAKE_INSTALL_PREFIX="$PREFIX" -DENABLED_PLUGINS="$ENABLED_PLUGINS" -DDISABLED_PLUGINS="$DISABLED_PLUGINS" -DVALA_EXECUTABLE="$VALA_EXECUTABLE" -DCMAKE_VALA_FLAGS="$VALAC_FLAGS" -DDISABLE_FAST_VAPI="$DISABLE_FAST_VAPI" -DLIB_SUFFIX="$LIB_SUFFIX" -DNO_DEBUG="$NO_DEBUG" .. || exit 9 if [ "$cmake_type" == "Ninja" ] then diff --git a/dino.spec b/dino.spec new file mode 100644 index 00000000..107eac33 --- /dev/null +++ b/dino.spec @@ -0,0 +1,115 @@ +# To build current git tree into RPM using tito: +# - Run `tito build --rpm --test` + +# To build latest tagged release from git into RPM using tito: +# - Run `tito build --rpm` + +# To build older tagged release from git into RPM using tito: +# - Run `tito build --rpm --tag=vVERSION` + +# To build a tagged release from git into RPM using rpmbuild: +# - Put version number into Version +# - Run `spectool -g -R dino.spec` +# - Run `rpmbuild -bb dino.spec` + +# To build a specific git commit into RPM using rpmbuild: +# - Put commit id into COMMIT_ID_HERE +# - Use second (currently commented) line for Release, Source0 and %setup +# - Run `spectool -g -R dino.spec` +# - Run `rpmbuild -bb dino.spec` + +%global commit COMMIT_ID_HERE +%global shortcommit %(c=%{commit}; echo ${c:0:7}) + +Name: dino +Version: 0 +Release: 0%{?dist} +#Release: 0.git.%{shortcommit}%{?dist} +Summary: Modern Jabber/XMPP Client using GTK+/Vala +License: GPLv3 +URL: https://github.com/dino/dino +Source0: https://github.com/dino/dino/archive/v%{version}.zip +#Source0: https://github.com/dino/dino/archive/%{commit}.zip +BuildRequires: vala >= 0.30 +BuildRequires: vala-tools >= 0.30 +BuildRequires: cmake +BuildRequires: git +BuildRequires: ninja-build +BuildRequires: desktop-file-utils +BuildRequires: pkgconfig(gthread-2.0) +BuildRequires: pkgconfig(glib-2.0) >= 2.38 +BuildRequires: pkgconfig(gio-2.0) +BuildRequires: pkgconfig(gtk+-3.0) >= 3.22 +BuildRequires: pkgconfig(gee-0.8) >= 0.10 +BuildRequires: pkgconfig(libnotify) +BuildRequires: pkgconfig(sqlite3) +BuildRequires: pkgconfig(openssl) +BuildRequires: gpgme-devel +Requires: hicolor-icon-theme + +%description +Dino is an instant messaging client for the Jabber/XMPP network, +providing a unique and modern user experience based on the latest +technology from the GNOME project. Dino is still in early +development and has limited features, but already has basic support +for XMPP's latest encryption features. Future versions will provide +a plug-in API, so that developers can easily add new optional +features. + +%package devel +Summary: Development files for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +The %{name}-devel package contains libraries and header files for +developing plugins for %{name}. + +%prep +%setup -n "dino-v%{version}" +#%setup -n "dino-%{commit}" + +%build +./configure --prefix="%{buildroot}%{_prefix}" --valac="%{_bindir}/valac%{?vala_version_suffix}" --lib-suffix="%{_lib}" +make + +%install +make install +desktop-file-validate %{buildroot}%{_datadir}/applications/dino.desktop + +%post +update-desktop-database &>/dev/null || : +touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : + +%postun +update-desktop-database &> /dev/null || : +if [ $1 -eq 0 ] ; then + touch --no-create %{_datadir}/icons/hicolor &>/dev/null + gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor &>/dev/null || : + glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || : +fi + +%posttrans +gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor &>/dev/null || : +glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || : + +%files +%license LICENSE +%doc README.md +%{_bindir}/dino +%{_libdir}/libdino.so +%{_libdir}/libqlite.so +%{_libdir}/libxmpp-vala.so +%{_datadir}/dino +%{_datadir}/applications/dino.desktop +%{_datadir}/glib-2.0/schemas/dino.gschema.xml +%{_datadir}/icons/hicolor/*/apps/dino.* +%{_datadir}/icons/hicolor/*/apps/dino-* +%{_datadir}/icons/hicolor/*/status/dino-* + +%files devel +%{_includedir}/* +%{_datadir}/vala/vapi + +%changelog +* Fri Mar 24 2017 - 0.0 +- Initial version -- cgit v1.2.3-54-g00ecf