- apt-get -q install -y python-dev libjpeg-dev zlib1g-dev
- echo " == Installing OpenJDK 7"
- apt-get -q install -y openjdk-7-jdk
- - echo " == Installing packages required by the 32-bit SDK"
- - apt-get -q install -y lib32stdc++6 lib32z1
- - echo " == Installing the Android SDK"
- - wget -q -O android-sdk.tgz https://dl.google.com/android/android-sdk_r24.4.1-linux.tgz
- - tar -x -z -f android-sdk.tgz
- - mv android-sdk-linux android-sdk
- - export ANDROID_HOME=$PWD/android-sdk
- - export PATH="$ANDROID_HOME/tools:$PATH"
- - echo " == Installing Android SDK components"
- - echo y | android -s update sdk --no-ui -a -t platform-tools,tools,build-tools-23.0.2
- - export PATH="$ANDROID_HOME/platform-tools:$PATH"
- - export PATH="$ANDROID_HOME/build-tools/23.0.2:$PATH"
+ - test -z "$ANDROID_HOME" &&
+ echo " == Installing Android SDK" &&
+ apt-get -q install -y lib32stdc++6 lib32z1 &&
+ wget -q -O android-sdk.tgz https://dl.google.com/android/android-sdk_r24.4.1-linux.tgz &&
+ tar -xzf android-sdk.tgz &&
+ export ANDROID_HOME=$PWD/android-sdk-linux &&
+ export PATH="$ANDROID_HOME/tools:$PATH" &&
+ echo y | android -s update sdk --no-ui -a -t platform-tools,tools,build-tools-23.0.2 &&
+ export PATH="$ANDROID_HOME/platform-tools:$PATH" &&
+ export PATH="$ANDROID_HOME/build-tools/23.0.2:$PATH" &&
+ echo y | android -s update sdk --no-ui -a -t android-10
test:
script:
'r10e': "/home/vagrant/android-ndk/r10e",
}
java_paths = {
- '1.7': "/usr/lib/jvm/java-7-openjdk-i386",
- '1.8': "/usr/lib/jvm/java-8-openjdk-i386",
+ '7': "/usr/lib/jvm/java-7-openjdk-i386",
+ '8': "/usr/lib/jvm/java-8-openjdk-i386",
}
opts="-c -v -q -b -i -I -e -w"
lopts="--create-metadata --verbose --quiet --buildreport
--interactive --icons --editor --wiki --pretty --clean --delete-unknown
- --nosign"
+ --nosign --use-date-from-apk"
case "${prev}" in
-e|--editor)
_filedir
they do not provide any option to reproduce or verify the resulting
binaries. Builds pre-release versions in some cases.
+@item
+@samp{Clojars} - Clojure libraries repo.
+
+@item
+@samp{CommonsWare} - repo holding a collection of open-source libs.
+
@end itemize
@item patch=x
options, parser = parse_commandline()
metadata_files = glob.glob('.fdroid.*[a-z]') # ignore files ending in ~
- if len(metadata_files) > 1:
+ if os.path.isdir('metadata'):
+ pass
+ elif len(metadata_files) == 0:
+ raise FDroidException("No app metadata found, nothing to process!")
+ elif len(metadata_files) > 1:
raise FDroidException("Only one local metadata file allowed! Found: "
+ " ".join(metadata_files))
- if not os.path.isdir('metadata') and len(metadata_files) == 0:
- raise FDroidException("No app metadata found, nothing to process!")
-
if not options.appid and not options.all:
parser.error("option %s: If you really want to build all the apps, use --all" % "all")
continue
j = os.path.basename(d)
# the last one found will be the canonical one, so order appropriately
- for regex in (r'1\.([6-9])\.0\.jdk', # OSX
- r'jdk1\.([6-9])\.0_[0-9]+.jdk', # OSX and Oracle tarball
- r'jdk([6-9])-openjdk', # Arch
- r'java-([6-9])-openjdk', # Arch
- r'java-([6-9])-jdk', # Arch (oracle)
- r'java-1\.([6-9])\.0-.*', # RedHat
- r'java-([6-9])-oracle', # Debian WebUpd8
- r'jdk-([6-9])-oracle-.*', # Debian make-jpkg
- r'java-([6-9])-openjdk-[^c][^o][^m].*'): # Debian
+ for regex in [
+ r'^1\.([6-9])\.0\.jdk$', # OSX
+ r'^jdk1\.([6-9])\.0_[0-9]+.jdk$', # OSX and Oracle tarball
+ r'^jdk([6-9])-openjdk$', # Arch
+ r'^java-([6-9])-openjdk$', # Arch
+ r'^java-([6-9])-jdk$', # Arch (oracle)
+ r'^java-1\.([6-9])\.0-.*$', # RedHat
+ r'^java-([6-9])-oracle$', # Debian WebUpd8
+ r'^jdk-([6-9])-oracle-.*$', # Debian make-jpkg
+ r'^java-([6-9])-openjdk-[^c][^o][^m].*$', # Debian
+ ]:
m = re.match(regex, j)
- if m:
- osxhome = os.path.join(d, 'Contents', 'Home')
- if os.path.exists(osxhome):
- thisconfig['java_paths'][m.group(1)] = osxhome
- else:
- thisconfig['java_paths'][m.group(1)] = d
+ if not m:
+ continue
+ osxhome = os.path.join(d, 'Contents', 'Home')
+ if os.path.exists(osxhome):
+ thisconfig['java_paths'][m.group(1)] = osxhome
+ else:
+ thisconfig['java_paths'][m.group(1)] = d
for java_version in ('7', '8', '9'):
if java_version not in thisconfig['java_paths']:
'oss.sonatype.org/content/repositories/releases',
'oss.sonatype.org/content/groups/public',
'clojars.org/repo', # Clojure free software libs
+ 's3.amazonaws.com/repo.commonsware.com', # CommonsWare
+ 'plugins.gradle.org/m2', # Gradle plugin repo
]
]
return md5(cert_encoded.encode('hex')).hexdigest()
-def scan_apks(apps, apkcache, repodir, knownapks):
+def scan_apks(apps, apkcache, repodir, knownapks, use_date_from_apk=False):
"""Scan the apks in the given repo directory.
This also extracts the icons.
:param apkcache: current apk cache information
:param repodir: repo directory to scan
:param knownapks: known apks info
+ :param use_date_from_apk: use date from APK (instead of current date)
+ for newly added APKs
:returns: (apks, cachechanged) where apks is a list of apk information,
and cachechanged is True if the apkcache got changed.
"""
# has to be more than 24 hours newer because ZIP/APK files do not
# store timezone info
manifest = apkzip.getinfo('AndroidManifest.xml')
- dt_obj = datetime(*manifest.date_time)
- checkdt = dt_obj - timedelta(1)
- if datetime.today() < checkdt:
- logging.warn('System clock is older than manifest in: '
- + apkfilename + '\nSet clock to that time using:\n'
- + 'sudo date -s "' + str(dt_obj) + '"')
+ if manifest.date_time[1] == 0: # month can't be zero
+ logging.debug('AndroidManifest.xml has no date')
+ else:
+ dt_obj = datetime(*manifest.date_time)
+ checkdt = dt_obj - timedelta(1)
+ if datetime.today() < checkdt:
+ logging.warn('System clock is older than manifest in: '
+ + apkfilename
+ + '\nSet clock to that time using:\n'
+ + 'sudo date -s "' + str(dt_obj) + '"')
iconfilename = "%s.%s.png" % (
apk['id'],
# Record in known apks, getting the added date at the same time..
added = knownapks.recordapk(apk['apkname'], apk['id'])
if added:
+ if use_date_from_apk and manifest.date_time[1] != 0:
+ added = datetime(*manifest.date_time).timetuple()
+ logging.debug("Using date from APK")
+
apk['added'] = added
apkcache[apkfilename] = apk
help="Clean update - don't uses caches, reprocess all apks")
parser.add_argument("--nosign", action="store_true", default=False,
help="When configured for signed indexes, create only unsigned indexes at this stage")
+ parser.add_argument("--use-date-from-apk", action="store_true", default=False,
+ help="Use date from apk instead of current time for newly added apks")
options = parser.parse_args()
config = common.read_config(options)
delete_disabled_builds(apps, apkcache, repodirs)
# Scan all apks in the main repo
- apks, cachechanged = scan_apks(apps, apkcache, repodirs[0], knownapks)
+ apks, cachechanged = scan_apks(apps, apkcache, repodirs[0], knownapks, options.use_date_from_apk)
# Generate warnings for apk's with no metadata (or create skeleton
# metadata files, if requested on the command line)
# Scan the archive repo for apks as well
if len(repodirs) > 1:
- archapks, cc = scan_apks(apps, apkcache, repodirs[1], knownapks)
+ archapks, cc = scan_apks(apps, apkcache, repodirs[1], knownapks, options.use_date_from_apk)
if cc:
cachechanged = True
else:
[metadata]
description-file = README.md
+
+[aliases]
+release = register sdist --sign upload
+
data_prefix = sys.prefix
setup(name='fdroidserver',
- version='0.5.0',
+ version='0.6.0',
description='F-Droid Server Tools',
long_description=open('README.md').read(),
author='The F-Droid Project',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
- 'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)'
+ 'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)',
'Operating System :: POSIX',
'Topic :: Utilities',
],