mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-21 16:55:46 +03:00
Add script for generating project tarball
This commit is contained in:
parent
b79a1b5755
commit
302cb27e98
5 changed files with 39 additions and 61 deletions
|
@ -3,7 +3,6 @@ cmake_minimum_required(VERSION 3.16 FATAL_ERROR) # Policies <= CMP0097 default t
|
||||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules)
|
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules)
|
||||||
|
|
||||||
project(qBittorrent
|
project(qBittorrent
|
||||||
VERSION 4.4.0.0
|
|
||||||
DESCRIPTION "The qBittorrent BitTorrent client"
|
DESCRIPTION "The qBittorrent BitTorrent client"
|
||||||
HOMEPAGE_URL "https://www.qbittorrent.org/"
|
HOMEPAGE_URL "https://www.qbittorrent.org/"
|
||||||
LANGUAGES CXX
|
LANGUAGES CXX
|
||||||
|
@ -55,25 +54,12 @@ include(GNUInstallDirs)
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
add_subdirectory(dist)
|
add_subdirectory(dist)
|
||||||
|
|
||||||
# Generate version header
|
|
||||||
set(QBT_VER_STATUS "alpha1" CACHE STRING "Project status version. Should be empty for release builds.")
|
|
||||||
|
|
||||||
set(QBT_PROJECT_VERSION "${qBittorrent_VERSION_MAJOR}.${qBittorrent_VERSION_MINOR}.${qBittorrent_VERSION_PATCH}")
|
|
||||||
if (NOT ${qBittorrent_VERSION_TWEAK} EQUAL 0)
|
|
||||||
set(QBT_PROJECT_VERSION "${QBT_PROJECT_VERSION}.${qBittorrent_VERSION_TWEAK}")
|
|
||||||
endif()
|
|
||||||
set(QBT_PROJECT_VERSION "${QBT_PROJECT_VERSION}${QBT_VER_STATUS}")
|
|
||||||
|
|
||||||
file(READ "src/base/version.h.in" versionHeader)
|
|
||||||
string(REPLACE "@VER_MAJOR@" ${qBittorrent_VERSION_MAJOR} versionHeader "${versionHeader}")
|
|
||||||
string(REPLACE "@VER_MINOR@" ${qBittorrent_VERSION_MINOR} versionHeader "${versionHeader}")
|
|
||||||
string(REPLACE "@VER_BUGFIX@" ${qBittorrent_VERSION_PATCH} versionHeader "${versionHeader}")
|
|
||||||
string(REPLACE "@VER_BUILD@" ${qBittorrent_VERSION_TWEAK} versionHeader "${versionHeader}")
|
|
||||||
string(REPLACE "@PROJECT_VERSION@" ${QBT_PROJECT_VERSION} versionHeader "${versionHeader}")
|
|
||||||
file(WRITE "src/base/version.h" "${versionHeader}")
|
|
||||||
|
|
||||||
if (VERBOSE_CONFIGURE)
|
if (VERBOSE_CONFIGURE)
|
||||||
feature_summary(WHAT ALL)
|
feature_summary(WHAT ALL)
|
||||||
else()
|
else()
|
||||||
feature_summary(WHAT ENABLED_FEATURES DISABLED_FEATURES)
|
feature_summary(WHAT ENABLED_FEATURES DISABLED_FEATURES)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Generate version header
|
||||||
|
file(READ "src/base/version.h.in" versionHeader)
|
||||||
|
file(WRITE "src/base/version.h" "${versionHeader}")
|
||||||
|
|
19
build_dist.sh
Executable file
19
build_dist.sh
Executable file
|
@ -0,0 +1,19 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# get version numbers
|
||||||
|
versionSrc="src/base/version.h.in"
|
||||||
|
versionMajor="$(grep -Po '(?<=QBT_VERSION_MAJOR )\d+' "$versionSrc")"
|
||||||
|
versionMinor="$(grep -Po '(?<=QBT_VERSION_MINOR )\d+' "$versionSrc")"
|
||||||
|
versionBugfix="$(grep -Po '(?<=QBT_VERSION_BUGFIX )\d+' "$versionSrc")"
|
||||||
|
versionBuild="$(grep -Po '(?<=QBT_VERSION_BUILD )\d+' "$versionSrc")"
|
||||||
|
versionStatus="$(grep -Po '(?<=QBT_VERSION_STATUS ")\w+' "$versionSrc")"
|
||||||
|
|
||||||
|
if [ "$versionBuild" != "0" ]; then
|
||||||
|
projectVersion="$versionMajor.$versionMinor.$versionBugfix.$versionBuild$versionStatus"
|
||||||
|
else
|
||||||
|
projectVersion="$versionMajor.$versionMinor.$versionBugfix$versionStatus"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# pack archives
|
||||||
|
git archive --format=tar --prefix="qbittorrent-$projectVersion/" HEAD | gzip -9 > "qbittorrent-$projectVersion.tar.gz"
|
||||||
|
git archive --format=tar --prefix="qbittorrent-$projectVersion/" HEAD | xz -9 > "qbittorrent-$projectVersion.tar.xz"
|
|
@ -4,19 +4,6 @@ SUBDIRS += src
|
||||||
|
|
||||||
include(version.pri)
|
include(version.pri)
|
||||||
|
|
||||||
# Make target to create release tarball. Use 'make tarball'
|
|
||||||
tarball.commands += rm -fR ../$${PROJECT_NAME}-$${PROJECT_VERSION}/ &&
|
|
||||||
tarball.commands += git clone . ../$${PROJECT_NAME}-$${PROJECT_VERSION} &&
|
|
||||||
tarball.commands += rm -fR ../$${PROJECT_NAME}-$${PROJECT_VERSION}/.git &&
|
|
||||||
tarball.commands += rm -f ../$${PROJECT_NAME}-$${PROJECT_VERSION}/.gitignore &&
|
|
||||||
tarball.commands += cd .. &&
|
|
||||||
tarball.commands += tar czf $${PROJECT_NAME}-$${PROJECT_VERSION}.tar.gz $${PROJECT_NAME}-$${PROJECT_VERSION} &&
|
|
||||||
tarball.commands += tar cf $${PROJECT_NAME}-$${PROJECT_VERSION}.tar $${PROJECT_NAME}-$${PROJECT_VERSION} &&
|
|
||||||
tarball.commands += xz -f $${PROJECT_NAME}-$${PROJECT_VERSION}.tar &&
|
|
||||||
tarball.commands += rm -fR $${PROJECT_NAME}-$${PROJECT_VERSION}
|
|
||||||
|
|
||||||
QMAKE_EXTRA_TARGETS += tarball
|
|
||||||
|
|
||||||
# For Qt Creator beautifier
|
# For Qt Creator beautifier
|
||||||
DISTFILES += \
|
DISTFILES += \
|
||||||
uncrustify.cfg
|
uncrustify.cfg
|
||||||
|
|
|
@ -28,10 +28,20 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define QBT_VERSION_MAJOR @VER_MAJOR@
|
#define QBT_VERSION_MAJOR 4
|
||||||
#define QBT_VERSION_MINOR @VER_MINOR@
|
#define QBT_VERSION_MINOR 4
|
||||||
#define QBT_VERSION_BUGFIX @VER_BUGFIX@
|
#define QBT_VERSION_BUGFIX 0
|
||||||
#define QBT_VERSION_BUILD @VER_BUILD@
|
#define QBT_VERSION_BUILD 0
|
||||||
|
#define QBT_VERSION_STATUS "alpha1" // Should be empty for stable releases!
|
||||||
|
|
||||||
#define QBT_VERSION "v@PROJECT_VERSION@"
|
#define QBT__STRINGIFY(x) #x
|
||||||
#define QBT_VERSION_2 "@PROJECT_VERSION@"
|
#define QBT_STRINGIFY(x) QBT__STRINGIFY(x)
|
||||||
|
|
||||||
|
#if (QBT_VERSION_BUILD != 0)
|
||||||
|
#define PROJECT_VERSION QBT_STRINGIFY(QBT_VERSION_MAJOR.QBT_VERSION_MINOR.QBT_VERSION_BUGFIX.QBT_VERSION_BUILD) QBT_VERSION_STATUS
|
||||||
|
#else
|
||||||
|
#define PROJECT_VERSION QBT_STRINGIFY(QBT_VERSION_MAJOR.QBT_VERSION_MINOR.QBT_VERSION_BUGFIX) QBT_VERSION_STATUS
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define QBT_VERSION "v" PROJECT_VERSION
|
||||||
|
#define QBT_VERSION_2 PROJECT_VERSION
|
||||||
|
|
24
version.pri
24
version.pri
|
@ -1,27 +1,3 @@
|
||||||
# keep it all lowercase to match program naming convention on *nix systems
|
|
||||||
PROJECT_NAME = qbittorrent
|
|
||||||
|
|
||||||
# Define version numbers here
|
|
||||||
VER_MAJOR = 4
|
|
||||||
VER_MINOR = 4
|
|
||||||
VER_BUGFIX = 0
|
|
||||||
VER_BUILD = 0
|
|
||||||
VER_STATUS = alpha1 # Should be empty for stable releases!
|
|
||||||
|
|
||||||
# Don't touch the rest part
|
|
||||||
PROJECT_VERSION = $${VER_MAJOR}.$${VER_MINOR}.$${VER_BUGFIX}
|
|
||||||
|
|
||||||
!equals(VER_BUILD, 0) {
|
|
||||||
PROJECT_VERSION = $${PROJECT_VERSION}.$${VER_BUILD}
|
|
||||||
}
|
|
||||||
|
|
||||||
PROJECT_VERSION = $${PROJECT_VERSION}$${VER_STATUS}
|
|
||||||
|
|
||||||
# Generate version header
|
# Generate version header
|
||||||
versionHeader = $$cat(src/base/version.h.in, blob)
|
versionHeader = $$cat(src/base/version.h.in, blob)
|
||||||
versionHeader = $$replace(versionHeader, "@VER_MAJOR@", $$VER_MAJOR)
|
|
||||||
versionHeader = $$replace(versionHeader, "@VER_MINOR@", $$VER_MINOR)
|
|
||||||
versionHeader = $$replace(versionHeader, "@VER_BUGFIX@", $$VER_BUGFIX)
|
|
||||||
versionHeader = $$replace(versionHeader, "@VER_BUILD@", $$VER_BUILD)
|
|
||||||
versionHeader = $$replace(versionHeader, "@PROJECT_VERSION@", $$PROJECT_VERSION)
|
|
||||||
write_file(src/base/version.h, versionHeader)
|
write_file(src/base/version.h, versionHeader)
|
||||||
|
|
Loading…
Reference in a new issue