Merge branch 'release-1.0'

This commit is contained in:
David Sansome 2011-12-28 00:00:24 +00:00
commit 8ecbbb1d17
13 changed files with 682 additions and 51 deletions

View File

@ -6,14 +6,14 @@ set(RPM_ARCH x86_64 CACHE STRING "Architecture of the rpm file")
add_custom_target(rpm
COMMAND ${CMAKE_SOURCE_DIR}/dist/maketarball.sh
COMMAND ${CMAKE_COMMAND} -E copy clementine-${CLEMENTINE_VERSION_RPM}.tar.gz ${RPMBUILD_DIR}/SOURCES/
COMMAND ${CMAKE_COMMAND} -E copy clementine-${CLEMENTINE_VERSION_SPARKLE}.tar.gz ${RPMBUILD_DIR}/SOURCES/
COMMAND rpmbuild -bs ${CMAKE_SOURCE_DIR}/dist/clementine.spec
COMMAND ${MOCK_COMMAND}
--verbose
--root=${MOCK_CHROOT}
--resultdir=${CMAKE_BINARY_DIR}/mock_result/
${RPMBUILD_DIR}/SRPMS/clementine-${CLEMENTINE_VERSION_RPM}-1.${RPM_DISTRO}.src.rpm
${RPMBUILD_DIR}/SRPMS/clementine-${CLEMENTINE_VERSION_RPM_V}-${CLEMENTINE_VERSION_RPM_R}.${RPM_DISTRO}.src.rpm
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_BINARY_DIR}/mock_result/clementine-${CLEMENTINE_VERSION_RPM}-1.${RPM_DISTRO}.${RPM_ARCH}.rpm
${CMAKE_BINARY_DIR}/clementine-${CLEMENTINE_VERSION_RPM}-1.${RPM_DISTRO}.${RPM_ARCH}.rpm
${CMAKE_BINARY_DIR}/mock_result/clementine-${CLEMENTINE_VERSION_RPM_V}-${CLEMENTINE_VERSION_RPM_R}.${RPM_DISTRO}.${RPM_ARCH}.rpm
${CMAKE_BINARY_DIR}/clementine-${CLEMENTINE_VERSION_RPM_V}-${CLEMENTINE_VERSION_RPM_R}.${RPM_DISTRO}.${RPM_ARCH}.rpm
)

View File

@ -1,37 +1,121 @@
# Change this file when releasing a new version.
# Version numbers.
set(CLEMENTINE_VERSION_MAJOR 0)
set(CLEMENTINE_VERSION_MINOR 7)
set(CLEMENTINE_VERSION_PATCH 1)
set(CLEMENTINE_VERSION_MAJOR 1)
set(CLEMENTINE_VERSION_MINOR 0)
set(CLEMENTINE_VERSION_PATCH 0)
#set(CLEMENTINE_VERSION_PRERELEASE rc1)
# This should be set to OFF in a tag
set(INCLUDE_GIT_REVISION ON)
# This should be set to OFF in a release branch
set(INCLUDE_GIT_REVISION OFF)
# The format for version numbers is:
# Display: $major.$minor[.$patch] [$prerelease] [r$svn]
# Deb: $major.$minor[.$patch][~$prerelease][.r$svn]
# Rpm: $major.$minor[.$patch][$prerelease][.r$svn]
# And the rpm version is used for mac and windows
# Rules about version number comparison on different platforms:
# Debian:
# Two stages are repeated until there are no more characters to compare:
# one block of consecutive digits (\d+) is compared numerically, then one
# block of consecutive NON-digits (\D+) is compared lexigraphically,
# with the exception that ~ sorts before everything else.
#
# The "upstream version" and "debian revision" are separated by the last
# dash in the version number.
#
# Algorithm is in "man deb-version", test comparisons with
# dpkg --compare-versions.
#
# These are in sorted order:
# 1.0~rc1
# 1.0~rc2
# 1.0
# 1.0-1-g044287b
# 1.0-506-g044287b
# 1.0.1
# 1.0.2
# 1.0.a
#
# Rpm:
# The string is split on non-alphanumeric characters. Numeric sections are
# compared numerically and non-numeric sections are compared lexigraphically.
# If one sections is numeric and the other sections is non-numeric, the
# numeric sections is always NEWER.
#
# The "version" and "release" fields are compared with the same algorithm -
# if the versions are equal the releases are compared to determine which
# package is newer.
#
# Algorithm is described in:
# http://fedoraproject.org/wiki/Packaging:NamingGuidelines#Package_Versioning
# Test comparisons with:
# import rpm
# rpm.labelCompare((epoch, version, release), (epoch, version, release))
#
# These are in sorted order:
# 1.0-0.rc1
# 1.0-0.rc2
# 1.0-1
# 1.0-2.506-g044287b
# 1.0.1-1
# 1.0.2-1
#
# Sparkle (mac) and QtSparkle (windows):
# The strings are split into sections of characters that are all of the same
# "type" - where a "type" is period, digit, or other. Sections are then
# compared against each other - digits are compared numerically and other
# are compared lexigraphically. When two sections are of different types,
# the numeric section is always NEWER.
#
# If the common parts of both strings are equal, but one string has more
# sections, the type of the first extra section is used to determine which
# version is newer.
# If the extra section is a string, the shorter result is NEWER, otherwise
# the shorter section is OLDER. That means that 1.0 is NEWER than 1.0rc1,
# but 1.0 is OLDER than 1.0.1.
#
# See compareversions.cpp in QtSparkle.
# Version numbers in Clementine:
# Deb:
# With git: $tagname-$commitcount-g$sha1
# Without git: $major.$minor.$patch[~$prerelease]
#
# Rpm: Version Release
# Prerelease: $major.$minor.$patch 0.$prerelease
# Without git: $major.$minor.$patch 1
# With git: $tagname 2.$commitcount.g$sha1
#
# QtSparkle (Windows):
# With git: $tagname-$commitcount-g$sha1
# Without git: $major.$minor.$patch[$prerelease]
#
# Mac info.plist: CFBundleVersion
# Prerelease: 4096.$major.$minor.$patch.0
# Without git: 4096.$major.$minor.$patch.1
# With git: 4096.$tagname.2.$commitcount
# The 4096. prefix is because the previous versioning scheme used svn revision
# numbers, which got up to 3000+.
set(CLEMENTINE_VERSION_DISPLAY "${CLEMENTINE_VERSION_MAJOR}.${CLEMENTINE_VERSION_MINOR}")
set(CLEMENTINE_VERSION_DEB "${CLEMENTINE_VERSION_MAJOR}.${CLEMENTINE_VERSION_MINOR}")
set(CLEMENTINE_VERSION_RPM "${CLEMENTINE_VERSION_MAJOR}.${CLEMENTINE_VERSION_MINOR}")
set(majorminorpatch "${CLEMENTINE_VERSION_MAJOR}.${CLEMENTINE_VERSION_MINOR}.${CLEMENTINE_VERSION_PATCH}")
# Add patch
if(CLEMENTINE_VERSION_PATCH)
set(CLEMENTINE_VERSION_DISPLAY "${CLEMENTINE_VERSION_DISPLAY}.${CLEMENTINE_VERSION_PATCH}")
set(CLEMENTINE_VERSION_DEB "${CLEMENTINE_VERSION_DEB}.${CLEMENTINE_VERSION_PATCH}")
set(CLEMENTINE_VERSION_RPM "${CLEMENTINE_VERSION_RPM}.${CLEMENTINE_VERSION_PATCH}")
endif(CLEMENTINE_VERSION_PATCH)
set(CLEMENTINE_VERSION_DISPLAY "${majorminorpatch}")
set(CLEMENTINE_VERSION_DEB "${majorminorpatch}")
set(CLEMENTINE_VERSION_RPM_V "${majorminorpatch}")
set(CLEMENTINE_VERSION_RPM_R "1")
set(CLEMENTINE_VERSION_SPARKLE "${majorminorpatch}")
set(CLEMENTINE_VERSION_PLIST "4096.${majorminorpatch}")
if(${CLEMENTINE_VERSION_PATCH} EQUAL "0")
set(CLEMENTINE_VERSION_DISPLAY "${CLEMENTINE_VERSION_MAJOR}.${CLEMENTINE_VERSION_MINOR}")
endif(${CLEMENTINE_VERSION_PATCH} EQUAL "0")
# Add prerelease
if(CLEMENTINE_VERSION_PRERELEASE)
set(CLEMENTINE_VERSION_DISPLAY "${CLEMENTINE_VERSION_DISPLAY} ${CLEMENTINE_VERSION_PRERELEASE}")
set(CLEMENTINE_VERSION_DEB "${CLEMENTINE_VERSION_DEB}~${CLEMENTINE_VERSION_PRERELEASE}")
set(CLEMENTINE_VERSION_RPM "${CLEMENTINE_VERSION_RPM}${CLEMENTINE_VERSION_PRERELEASE}")
set(CLEMENTINE_VERSION_DEB "${CLEMENTINE_VERSION_DEB}~${CLEMENTINE_VERSION_PRERELEASE}")
set(CLEMENTINE_VERSION_RPM_R "0.${CLEMENTINE_VERSION_PRERELEASE}")
set(CLEMENTINE_VERSION_SPARKLE "${CLEMENTINE_VERSION_SPARKLE}${CLEMENTINE_VERSION_PRERELEASE}")
set(CLEMENTINE_VERSION_PLIST "${CLEMENTINE_VERSION_PLIST}.0")
else(CLEMENTINE_VERSION_PRERELEASE)
set(CLEMENTINE_VERSION_PLIST "${CLEMENTINE_VERSION_PLIST}.1")
endif(CLEMENTINE_VERSION_PRERELEASE)
# Add git revision
@ -46,16 +130,36 @@ else(FORCE_GIT_REVISION)
OUTPUT_VARIABLE GIT_REV
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(${GIT_INFO_RESULT} EQUAL 0)
set(GIT_REVISION ${GIT_REV})
string(REGEX REPLACE "^(.+)-([0-9]+)-(g[a-f0-9]+)$" "\\1;\\2;\\3"
GIT_PARTS ${GIT_REV})
if(NOT GIT_PARTS)
message(FATAL_ERROR "Failed to parse git revision string '${GIT_REV}'")
endif(NOT GIT_PARTS)
list(GET GIT_PARTS 0 GIT_TAGNAME)
list(GET GIT_PARTS 1 GIT_COMMITCOUNT)
list(GET GIT_PARTS 2 GIT_SHA1)
set(HAS_GET_REVISION ON)
endif(${GIT_INFO_RESULT} EQUAL 0)
endif(NOT GIT_EXECUTABLE-NOTFOUND)
endif(FORCE_GIT_REVISION)
if(INCLUDE_GIT_REVISION AND GIT_REVISION)
set(CLEMENTINE_VERSION_DISPLAY "${GIT_REVISION}")
set(CLEMENTINE_VERSION_DEB "${GIT_REVISION}")
if(INCLUDE_GIT_REVISION AND HAS_GET_REVISION)
set(CLEMENTINE_VERSION_DISPLAY "${GIT_REV}")
set(CLEMENTINE_VERSION_DEB "${GIT_REV}")
set(CLEMENTINE_VERSION_RPM_V "${GIT_TAGNAME}")
set(CLEMENTINE_VERSION_RPM_R "2.${GIT_COMMITCOUNT}.${GIT_SHA1}")
set(CLEMENTINE_VERSION_SPARKLE "${GIT_REV}")
set(CLEMENTINE_VERSION_PLIST "4096.${GIT_TAGNAME}.2.${GIT_COMMITCOUNT}")
endif(INCLUDE_GIT_REVISION AND HAS_GET_REVISION)
# RPM doesn't like dashes in version numbers
string(REPLACE "-" "." CLEMENTINE_VERSION_RPM "${GIT_REVISION}")
endif(INCLUDE_GIT_REVISION AND GIT_REVISION)
if(0)
message(STATUS "Display: ${CLEMENTINE_VERSION_DISPLAY}")
message(STATUS "Deb: ${CLEMENTINE_VERSION_DEB}")
message(STATUS "Rpm: ${CLEMENTINE_VERSION_RPM_V}-${CLEMENTINE_VERSION_RPM_R}")
message(STATUS "Sparkle: ${CLEMENTINE_VERSION_SPARKLE}")
message(STATUS "Plist: ${CLEMENTINE_VERSION_PLIST}")
endif(0)

4
dist/Info.plist.in vendored
View File

@ -21,9 +21,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>${CLEMENTINE_VERSION_RPM}</string>
<string>${CLEMENTINE_VERSION_DISPLAY}</string>
<key>CFBundleVersion</key>
<string>${SVN_REVISION}</string>
<string>${CLEMENTINE_VERSION_PLIST}</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>LSRequiresCarbon</key>

View File

@ -1,12 +1,12 @@
Name: clementine
Version: @CLEMENTINE_VERSION_RPM@
Release: 1.@RPM_DISTRO@
Version: @CLEMENTINE_VERSION_RPM_V@
Release: @CLEMENTINE_VERSION_RPM_R@.@RPM_DISTRO@
Summary: A music player and library organiser
Group: Applications/Multimedia
License: GPLv3
URL: http://www.clementine-player.org/
Source0: %{name}-%{version}.tar.gz
Source0: %{name}-@CLEMENTINE_VERSION_SPARKLE@.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: desktop-file-utils liblastfm-devel taglib-devel gettext
@ -55,7 +55,7 @@ Features include:
* Queue manager
%prep
%setup -q
%setup -q -n %{name}-@CLEMENTINE_VERSION_SPARKLE@
%build
@ -83,5 +83,5 @@ make clean
%{_datadir}/clementine/projectm-presets
%changelog
* @RPM_DATE@ David Sansome <me@davidsansome.com> - @CLEMENTINE_VERSION_RPM@
* @RPM_DATE@ David Sansome <me@davidsansome.com> - @CLEMENTINE_VERSION_RPM_V@
- Version @CLEMENTINE_VERSION_DISPLAY@

248
dist/googlecode_upload.py vendored Normal file
View File

@ -0,0 +1,248 @@
#!/usr/bin/env python
#
# Copyright 2006, 2007 Google Inc. All Rights Reserved.
# Author: danderson@google.com (David Anderson)
#
# Script for uploading files to a Google Code project.
#
# This is intended to be both a useful script for people who want to
# streamline project uploads and a reference implementation for
# uploading files to Google Code projects.
#
# To upload a file to Google Code, you need to provide a path to the
# file on your local machine, a small summary of what the file is, a
# project name, and a valid account that is a member or owner of that
# project. You can optionally provide a list of labels that apply to
# the file. The file will be uploaded under the same name that it has
# in your local filesystem (that is, the "basename" or last path
# component). Run the script with '--help' to get the exact syntax
# and available options.
#
# Note that the upload script requests that you enter your
# googlecode.com password. This is NOT your Gmail account password!
# This is the password you use on googlecode.com for committing to
# Subversion and uploading files. You can find your password by going
# to http://code.google.com/hosting/settings when logged in with your
# Gmail account. If you have already committed to your project's
# Subversion repository, the script will automatically retrieve your
# credentials from there (unless disabled, see the output of '--help'
# for details).
#
# If you are looking at this script as a reference for implementing
# your own Google Code file uploader, then you should take a look at
# the upload() function, which is the meat of the uploader. You
# basically need to build a multipart/form-data POST request with the
# right fields and send it to https://PROJECT.googlecode.com/files .
# Authenticate the request using HTTP Basic authentication, as is
# shown below.
#
# Licensed under the terms of the Apache Software License 2.0:
# http://www.apache.org/licenses/LICENSE-2.0
#
# Questions, comments, feature requests and patches are most welcome.
# Please direct all of these to the Google Code users group:
# http://groups.google.com/group/google-code-hosting
"""Google Code file uploader script.
"""
__author__ = 'danderson@google.com (David Anderson)'
import httplib
import os.path
import optparse
import getpass
import base64
import sys
def upload(file, project_name, user_name, password, summary, labels=None):
"""Upload a file to a Google Code project's file server.
Args:
file: The local path to the file.
project_name: The name of your project on Google Code.
user_name: Your Google account name.
password: The googlecode.com password for your account.
Note that this is NOT your global Google Account password!
summary: A small description for the file.
labels: an optional list of label strings with which to tag the file.
Returns: a tuple:
http_status: 201 if the upload succeeded, something else if an
error occured.
http_reason: The human-readable string associated with http_status
file_url: If the upload succeeded, the URL of the file on Google
Code, None otherwise.
"""
# The login is the user part of user@gmail.com. If the login provided
# is in the full user@domain form, strip it down.
if user_name.endswith('@gmail.com'):
user_name = user_name[:user_name.index('@gmail.com')]
form_fields = [('summary', summary)]
if labels is not None:
form_fields.extend([('label', l.strip()) for l in labels])
content_type, body = encode_upload_request(form_fields, file)
upload_host = '%s.googlecode.com' % project_name
upload_uri = '/files'
auth_token = base64.b64encode('%s:%s'% (user_name, password))
headers = {
'Authorization': 'Basic %s' % auth_token,
'User-Agent': 'Googlecode.com uploader v0.9.4',
'Content-Type': content_type,
}
server = httplib.HTTPSConnection(upload_host)
server.request('POST', upload_uri, body, headers)
resp = server.getresponse()
server.close()
if resp.status == 201:
location = resp.getheader('Location', None)
else:
location = None
return resp.status, resp.reason, location
def encode_upload_request(fields, file_path):
"""Encode the given fields and file into a multipart form body.
fields is a sequence of (name, value) pairs. file is the path of
the file to upload. The file will be uploaded to Google Code with
the same file name.
Returns: (content_type, body) ready for httplib.HTTP instance
"""
BOUNDARY = '----------Googlecode_boundary_reindeer_flotilla'
CRLF = '\r\n'
body = []
# Add the metadata about the upload first
for key, value in fields:
body.extend(
['--' + BOUNDARY,
'Content-Disposition: form-data; name="%s"' % key,
'',
value,
])
# Now add the file itself
file_name = os.path.basename(file_path)
f = open(file_path, 'rb')
file_content = f.read()
f.close()
body.extend(
['--' + BOUNDARY,
'Content-Disposition: form-data; name="filename"; filename="%s"'
% file_name,
# The upload server determines the mime-type, no need to set it.
'Content-Type: application/octet-stream',
'',
file_content,
])
# Finalize the form body
body.extend(['--' + BOUNDARY + '--', ''])
return 'multipart/form-data; boundary=%s' % BOUNDARY, CRLF.join(body)
def upload_find_auth(file_path, project_name, summary, labels=None,
user_name=None, password=None, tries=3):
"""Find credentials and upload a file to a Google Code project's file server.
file_path, project_name, summary, and labels are passed as-is to upload.
Args:
file_path: The local path to the file.
project_name: The name of your project on Google Code.
summary: A small description for the file.
labels: an optional list of label strings with which to tag the file.
config_dir: Path to Subversion configuration directory, 'none', or None.
user_name: Your Google account name.
tries: How many attempts to make.
"""
while tries > 0:
if user_name is None:
# Read username if not specified or loaded from svn config, or on
# subsequent tries.
sys.stdout.write('Please enter your googlecode.com username: ')
sys.stdout.flush()
user_name = sys.stdin.readline().rstrip()
if password is None:
# Read password if not loaded from svn config, or on subsequent tries.
print 'Please enter your googlecode.com password.'
print '** Note that this is NOT your Gmail account password! **'
print 'It is the password you use to access Subversion repositories,'
print 'and can be found here: http://code.google.com/hosting/settings'
password = getpass.getpass()
status, reason, url = upload(file_path, project_name, user_name, password,
summary, labels)
# Returns 403 Forbidden instead of 401 Unauthorized for bad
# credentials as of 2007-07-17.
if status in [httplib.FORBIDDEN, httplib.UNAUTHORIZED]:
# Rest for another try.
user_name = password = None
tries = tries - 1
else:
# We're done.
break
return status, reason, url
def main():
parser = optparse.OptionParser(usage='googlecode-upload.py -s SUMMARY '
'-p PROJECT [options] FILE')
parser.add_option('-s', '--summary', dest='summary',
help='Short description of the file')
parser.add_option('-p', '--project', dest='project',
help='Google Code project name')
parser.add_option('-u', '--user', dest='user',
help='Your Google Code username')
parser.add_option('-w', '--password', dest='password',
help='Your Google Code password')
parser.add_option('-l', '--labels', dest='labels',
help='An optional list of comma-separated labels to attach '
'to the file')
options, args = parser.parse_args()
if not options.summary:
parser.error('File summary is missing.')
elif not options.project:
parser.error('Project name is missing.')
elif len(args) < 1:
parser.error('File to upload not provided.')
elif len(args) > 1:
parser.error('Only one file may be specified.')
file_path = args[0]
if options.labels:
labels = options.labels.split(',')
else:
labels = None
status, reason, url = upload_find_auth(file_path, options.project,
options.summary, labels,
options.user, options.password)
if url:
print 'The file was uploaded successfully.'
print 'URL: %s' % url
return 0
else:
print 'An error occurred. Your file was not uploaded.'
print 'Google Code upload server said: %s (%s)' % (reason, status)
return 1
if __name__ == '__main__':
sys.exit(main())

226
dist/googlecode_upload_all.py vendored Normal file
View File

@ -0,0 +1,226 @@
import getpass
import os
import re
import subprocess
import sys
import googlecode_upload
PROJECT_NAME = "clementine-player"
FILENAME_PATTERNS = {
"deb": "clementine_%(major)s.%(minor)s.%(patch)s%(tildeprerelease)s~%(distro)s_%(debarch)s.deb",
"rpm": "clementine-%(major)s.%(minor)s.%(patch)s-%(rpmrelease)s.%(distro)s.%(rpmarch)s.rpm",
"exe": "ClementineSetup-%(major)s.%(minor)s.%(patch)s%(prerelease)s.exe",
"dmg": "clementine-%(major)s.%(minor)s.%(patch)s%(prerelease)s.dmg",
"tar.gz": "clementine-%(major)s.%(minor)s.%(patch)s%(prerelease)s.tar.gz",
}
LABELS = {
"deb": ["Type-Package", "OpSys-Linux"],
"rpm": ["Type-Package", "OpSys-Linux", "Distro-Fedora"],
"exe": ["Type-Package", "OpSys-Windows", "Arch-i386"],
"dmg": ["Type-Package", "OpSys-OSX", "Distro-SnowLeopard", "Arch-x86-64"],
32: ["Arch-i386"],
64: ["Arch-x86-64"],
"lucid": ["Distro-Ubuntu"],
"maverick": ["Distro-Ubuntu"],
"natty": ["Distro-Ubuntu"],
"oneiric": ["Distro-Ubuntu"],
"squeeze": ["Distro-Debian"],
}
MIN_SIZE = {
"deb": 5000000,
"rpm": 4000000,
"exe": 18000000,
"dmg": 24000000,
"tar.gz": 8000000,
}
DEB_ARCH = {
32: "i386",
64: "amd64",
}
RPM_ARCH = {
32: "i686",
64: "x86_64",
}
DESCRIPTIONS = {
("deb", "lucid"): "for Ubuntu Lucid (10.04)",
("deb", "maverick"): "for Ubuntu Maverick (10.10)",
("deb", "natty"): "for Ubuntu Natty (11.04)",
("deb", "oneiric"): "for Ubuntu Oneiric (11.10)",
("deb", "squeeze"): "for Debian Squeeze",
("rpm", "fc15"): "for Fedora 15",
("rpm", "fc16"): "for Fedora 16",
("exe", None): "for Windows",
("dmg", None): "for Mac OS X",
("tar.gz", None): "source",
}
RELEASES = [
("deb", "lucid", 32),
("deb", "lucid", 64),
("deb", "maverick", 32),
("deb", "maverick", 64),
("deb", "natty", 32),
("deb", "natty", 64),
("deb", "oneiric", 32),
("deb", "oneiric", 64),
("deb", "squeeze", 32),
("deb", "squeeze", 64),
("rpm", "fc15", 32),
("rpm", "fc15", 64),
("rpm", "fc16", 32),
("rpm", "fc16", 64),
("exe", None, None),
("dmg", None, None),
("tar.gz", None, None),
]
class VersionInfo(object):
def __init__(self, root_dir):
filename = os.path.join(root_dir, "cmake/Version.cmake")
data = open(filename).read()
self.info = {
"major": self._version(data, "MAJOR"),
"minor": self._version(data, "MINOR"),
"patch": self._version(data, "PATCH"),
"prerelease": self._version(data, "PRERELEASE"),
}
for key, value in self.info.items():
setattr(self, key, value)
def _version(self, data, part):
regex = r"^set\(CLEMENTINE_VERSION_%s (\w+)\)$" % part
match = re.search(regex, data, re.MULTILINE)
if not match:
return ""
return match.group(1)
def filename(self, release):
(package, distro, arch) = release
data = dict(self.info)
data["distro"] = distro
data["rpmarch"] = RPM_ARCH.get(arch, None)
data["debarch"] = DEB_ARCH.get(arch, None)
data["tildeprerelease"] = ""
data["rpmrelease"] = "1"
if data["prerelease"]:
data["tildeprerelease"] = "~%s" % data["prerelease"]
data["rpmrelease"] = "0.%s" % data["prerelease"]
return FILENAME_PATTERNS[package] % data
def description(self, release):
(package, distro, arch) = release
version_name = "%(major)s.%(minor)s" % self.info
if self.patch is not "0":
version_name += ".%s" % self.patch
if self.prerelease:
version_name += " %s" % self.prerelease.upper()
os_name = DESCRIPTIONS[(package, distro)]
if arch is not None:
os_name += " %d-bit" % arch
return "Clementine %s %s" % (version_name, os_name)
def labels(self, release):
(package, distro, arch) = release
labels = LABELS.get(package, []) + \
LABELS.get(distro, []) + \
LABELS.get(arch, [])
if self.prerelease.startswith("rc"):
labels.append("Release-RC")
elif self.prerelease.startswith("beta"):
labels.append("Release-Beta")
else:
labels.append("Release-Stable")
return labels
def main():
dist_dir = os.path.dirname(os.path.abspath(__file__))
root_dir = os.path.normpath(os.path.join(dist_dir, ".."))
# Read the version file
version = VersionInfo(root_dir)
# Display the files that will be uploaded
for release in RELEASES:
filename = version.filename(release)
description = version.description(release)
if not os.path.exists(filename):
print
print "%s - file not found" % filename
print "Run this script from a directory containing all the release packages"
return 1
size = os.path.getsize(filename)
if size < MIN_SIZE[release[0]]:
print
print "%s - file not big enough" % filename
print "%s files are expected to be at least %d bytes, but this was %d bytes" % (
release[0], MIN_SIZE[release[0]], size)
return 1
labels = version.labels(release)
print "%-40s %15s %-55s %s" % (filename, "%d bytes" % size, description, " ".join(sorted(labels)))
print
# Prompt for username and password
username = raw_input("Google username: ")
if not username:
return 1
password = getpass.getpass("Google Code password (different to your Google account): ")
if not password:
return 1
print
# Upload everything
for release in RELEASES:
(status, reason, url) = googlecode_upload.upload(
file=version.filename(release),
project_name=PROJECT_NAME,
user_name=username,
password=password,
summary=version.description(release),
labels=version.labels(release),
)
if status != 201:
print "%s: (%d) %s" % (version.filename(release), status, reason)
else:
print "Uploaded %s" % url
return 0
if __name__ == "__main__":
sys.exit(main())

View File

@ -1,8 +1,7 @@
#!/bin/bash
name=clementine
version="@CLEMENTINE_VERSION_RPM@"
deb_version="@CLEMENTINE_VERSION_DEB@"
version="@CLEMENTINE_VERSION_SPARKLE@"
deb_dist="@DEB_DIST@"
root=$(cd "${0%/*}/.." && echo $PWD/${0##*/})
root=`dirname "$root"`
@ -17,6 +16,6 @@ tar -czf $name-$version.tar.gz "$root" \
--exclude "$root/debian" \
--exclude "$root/dist/*.tar.gz"
echo "Also creating ${name}_${deb_version}~${deb_dist}.orig.tar.gz..."
cp "$name-$version.tar.gz" "${name}_${deb_version}~${deb_dist}.orig.tar.gz"
echo "Also creating ${name}_${version}~${deb_dist}.orig.tar.gz..."
cp "$name-$version.tar.gz" "${name}_${version}~${deb_dist}.orig.tar.gz"

48
dist/versionnumbers.py vendored Normal file
View File

@ -0,0 +1,48 @@
import rpm
import subprocess
deb_versions = [
"1.0",
"1.0.1",
"1.0.2",
"1.0.a",
"1.0~rc1",
"1.0~rc2",
"1.0-506-g044287b",
"1.0-1-g044287b",
]
rpm_versions = [
("1.0", "1"),
("1.0.1", "1"),
("1.0.2", "1"),
("1.0", "0.rc1"),
("1.0", "0.rc2"),
("1.0", "2.506-g044287b"),
]
def compare_deb(left, right):
if subprocess.call(["dpkg", "--compare-versions", left, "lt", right]) == 0:
return -1
if subprocess.call(["dpkg", "--compare-versions", left, "eq", right]) == 0:
return 0
if subprocess.call(["dpkg", "--compare-versions", left, "gt", right]) == 0:
return 1
raise Exception("Couldn't compare versions %s %s" % (left, right))
def compare_rpm(left, right):
return rpm.labelCompare(("1", left[0], left[1]), ("1", right[0], right[1]))
def sort_and_print(l, cmp):
for v in sorted(l, cmp=cmp):
if isinstance(v, tuple):
print "%s-%s" % v
else:
print v
print
sort_and_print(deb_versions, compare_deb)
sort_and_print(rpm_versions, compare_rpm)

View File

@ -48,7 +48,7 @@ SetCompressor /SOLID lzma
!insertmacro MUI_LANGUAGE "English"
Name "${PRODUCT_NAME}"
OutFile "${PRODUCT_NAME}Setup-@CLEMENTINE_VERSION_RPM@.exe"
OutFile "${PRODUCT_NAME}Setup-@CLEMENTINE_VERSION_SPARKLE@.exe"
InstallDir "${PRODUCT_INSTALL_DIR}"
ShowInstDetails show
ShowUnInstDetails show
@ -130,6 +130,7 @@ Section "Clementine" Clementine
File "libgstbase-0.10-0.dll"
File "libgstcdda-0.10-0.dll"
File "libgstcontroller-0.10-0.dll"
File "libgstdataprotocol-0.10-0.dll"
File "libgstfft-0.10-0.dll"
File "libgstinterfaces-0.10-0.dll"
File "libgstnet-0.10-0.dll"
@ -274,6 +275,7 @@ Section "Gstreamer plugins" gstreamer-plugins
File "/oname=libgstspectrum.dll" "gstreamer-plugins\libgstspectrum.dll"
File "/oname=libgstspeex.dll" "gstreamer-plugins\libgstspeex.dll"
File "/oname=libgsttaglib.dll" "gstreamer-plugins\libgsttaglib.dll"
File "/oname=libgsttcp.dll" "gstreamer-plugins\libgsttcp.dll"
File "/oname=libgsttypefindfunctions.dll" "gstreamer-plugins\libgsttypefindfunctions.dll"
File "/oname=libgstudp.dll" "gstreamer-plugins\libgstudp.dll"
File "/oname=libgstvolume.dll" "gstreamer-plugins\libgstvolume.dll"
@ -964,10 +966,12 @@ Section "Uninstall"
Delete "$INSTDIR\libgnutls-26.dll"
Delete "$INSTDIR\libgobject-2.0-0.dll"
Delete "$INSTDIR\libgpg-error-0.dll"
Delete "$INSTDIR\libgstapp-0.10-0.dll"
Delete "$INSTDIR\libgstaudio-0.10-0.dll"
Delete "$INSTDIR\libgstbase-0.10-0.dll"
Delete "$INSTDIR\libgstcdda-0.10-0.dll"
Delete "$INSTDIR\libgstcontroller-0.10-0.dll"
Delete "$INSTDIR\libgstdataprotocol-0.10-0.dll"
Delete "$INSTDIR\libgstfft-0.10-0.dll"
Delete "$INSTDIR\libgstinterfaces-0.10-0.dll"
Delete "$INSTDIR\libgstnet-0.10-0.dll"
@ -1020,6 +1024,7 @@ Section "Uninstall"
Delete "$INSTDIR\imageformats\qjpeg4.dll"
Delete "$INSTDIR\gstreamer-plugins\libgstapetag.dll"
Delete "$INSTDIR\gstreamer-plugins\libgstapp.dll"
Delete "$INSTDIR\gstreamer-plugins\libgstasf.dll"
Delete "$INSTDIR\gstreamer-plugins\libgstaudioconvert.dll"
Delete "$INSTDIR\gstreamer-plugins\libgstaudiofx.dll"
@ -1051,6 +1056,7 @@ Section "Uninstall"
Delete "$INSTDIR\gstreamer-plugins\libgstspeex.dll"
Delete "$INSTDIR\gstreamer-plugins\libgstsouphttpsrc.dll"
Delete "$INSTDIR\gstreamer-plugins\libgsttaglib.dll"
Delete "$INSTDIR\gstreamer-plugins\libgsttcp.dll"
Delete "$INSTDIR\gstreamer-plugins\libgsttypefindfunctions.dll"
Delete "$INSTDIR\gstreamer-plugins\libgstudp.dll"
Delete "$INSTDIR\gstreamer-plugins\libgstvolume.dll"

View File

@ -1171,17 +1171,17 @@ if (APPLE)
add_custom_command(
OUTPUT ${PROJECT_BINARY_DIR}/clementine-${CLEMENTINE_VERSION_RPM}.dmg
${CMAKE_COMMAND} -E remove -f ${PROJECT_BINARY_DIR}/clementine-${CLEMENTINE_VERSION_RPM}.dmg
OUTPUT ${PROJECT_BINARY_DIR}/clementine-${CLEMENTINE_VERSION_SPARKLE}.dmg
${CMAKE_COMMAND} -E remove -f ${PROJECT_BINARY_DIR}/clementine-${CLEMENTINE_VERSION_SPARKLE}.dmg
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/../dist/create-dmg.sh ${PROJECT_BINARY_DIR}/clementine.app
COMMAND ${CMAKE_COMMAND} -E rename
${PROJECT_BINARY_DIR}/clementine.dmg
${PROJECT_BINARY_DIR}/clementine-${CLEMENTINE_VERSION_RPM}.dmg
${PROJECT_BINARY_DIR}/clementine-${CLEMENTINE_VERSION_SPARKLE}.dmg
DEPENDS clementine
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
)
add_custom_target(dmg
DEPENDS ${PROJECT_BINARY_DIR}/clementine-${CLEMENTINE_VERSION_RPM}.dmg)
DEPENDS ${PROJECT_BINARY_DIR}/clementine-${CLEMENTINE_VERSION_SPARKLE}.dmg)
else (APPLE)
install(TARGETS clementine
RUNTIME DESTINATION bin

View File

@ -45,7 +45,7 @@ GlobalSearchTooltip::GlobalSearchTooltip(QWidget* event_target)
active_result_(0),
show_tooltip_help_(true)
{
setWindowFlags(Qt::Popup);
setWindowFlags(Qt::FramelessWindowHint | Qt::Popup);
setFocusPolicy(Qt::NoFocus);
setAttribute(Qt::WA_NoSystemBackground);
setAttribute(Qt::WA_TranslucentBackground);

View File

@ -612,7 +612,7 @@ MainWindow::MainWindow(
qtsparkle::Updater* updater = new qtsparkle::Updater(
QUrl("https://clementine-data.appspot.com/sparkle-windows"), this);
updater->SetNetworkAccessManager(new NetworkAccessManager(this));
updater->SetVersion(CLEMENTINE_VERSION);
updater->SetVersion(CLEMENTINE_VERSION_SPARKLE);
connect(check_updates, SIGNAL(triggered()), updater, SLOT(CheckNow()));
#endif

View File

@ -18,6 +18,6 @@
#define VERSION_H_IN
#define CLEMENTINE_VERSION_DISPLAY "${CLEMENTINE_VERSION_DISPLAY}"
#define CLEMENTINE_VERSION "${CLEMENTINE_VERSION_DEB}"
#define CLEMENTINE_VERSION_SPARKLE "${CLEMENTINE_VERSION_SPARKLE}"
#endif // VERSION_H_IN