Skip to content

Commit

Permalink
Version 6.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
luigifab committed Jul 7, 2022
1 parent c13a8af commit 255f56d
Show file tree
Hide file tree
Showing 48 changed files with 365 additions and 330 deletions.
6 changes: 4 additions & 2 deletions README.md
@@ -1,3 +1,5 @@
Stop russian war. **🇺🇦 Free Ukraine!**

# apijs

JavaScript pop-ups and slideshow for [Redmine](https://github.com/redmine/redmine).
Expand All @@ -6,8 +8,8 @@ For more information, go to https://www.luigifab.fr/apijs and https://www.luigif

This repository is a releases mirror. To install the plugin, please read the documentation.

- Current version: 6.8.2 (01/01/2022)
- Compatibility: Redmine 1.4 / 2.x / 3.x / 4.x, Python 3.3 - 3.10
- Current version: 6.9.0 (07/07/2022)
- Compatibility: Redmine 1.4 / 2.x / 3.x / 4.x / 5.x, Python 3.3+
- Client compatibility: Firefox 36+, Chrome 32+, Opera 19+, Edge 16+, Safari 9+
- Translations: English (en), French (fr-FR/fr-CA), German (de), Italian (it), Portuguese (pt-PT/pt-BR), Spanish (es) / Chinese (zh), Czech (cs), Dutch (nl), Greek (el), Hungarian (hu), Japanese (ja), Polish (pl), Romanian (ro), Russian (ru), Slovak (sk), Turkish (tr), Ukrainian (uk)
- License: GNU GPL 2+
Expand Down
6 changes: 3 additions & 3 deletions debian/changelog
@@ -1,5 +1,5 @@
redmine-plugin-apijs (6.8.2-1) unstable; urgency=low
redmine-plugin-apijs (6.9.0-1) experimental; urgency=low

* Initial debian package release (Closes: #959426)
* Initial Debian package release (Closes: #959426)

-- Fabrice Creuzot <code@luigifab.fr> Sat, 01 Jan 2022 20:00:00 +0000
-- Fabrice Creuzot <code@luigifab.fr> Thu, 07 Jul 2022 20:00:00 +0000
4 changes: 2 additions & 2 deletions debian/copyright
Expand Up @@ -14,8 +14,8 @@ License: SIL-1.1

Files: */lib/useragentparser.rb
Copyright:
2013-2021 Jesse G. Donat <donatj@gmail.com>
2019-2021 Fabrice Creuzot (luigifab) <code@luigifab.fr>
2013-2022 Jesse G. Donat <donatj@gmail.com>
2019-2022 Fabrice Creuzot (luigifab) <code@luigifab.fr>
License: Expat

License: GPL-2+
Expand Down
39 changes: 20 additions & 19 deletions debian/deb.sh
@@ -1,16 +1,16 @@
#!/bin/bash
# debian: sudo apt install dpkg-dev devscripts dh-make
# Debian: sudo apt install dpkg-dev devscripts dh-make


cd "$(dirname "$0")"
version="6.8.2"
version="6.9.0"


rm -rf builder/
mkdir builder

# copy to a tmp directory
if [ true ]; then
if [ ! true ]; then
cd builder
wget https://github.com/luigifab/redmine-apijs/archive/v$version/redmine-apijs-$version.tar.gz
tar xzf redmine-apijs-$version.tar.gz
Expand All @@ -30,33 +30,34 @@ else
fi


# create packages for debian and ubuntu
for serie in unstable jammy impish hirsute focal bionic xenial trusty; do
# create packages for Debian and Ubuntu
for serie in experimental kinetic jammy impish focal bionic xenial trusty; do

if [ $serie = "unstable" ]; then
# for ubuntu
if [ $serie = "experimental" ]; then
# for Ubuntu
cp -a builder/redmine-apijs-$version/ builder/redmine-apijs-$version+src/
# debian only
# Debian only
cd builder/redmine-apijs-$version/
else
# ubuntu only
# Ubuntu only
cp -a builder/redmine-apijs-$version+src/ builder/redmine-apijs+$serie-$version/
cd builder/redmine-apijs+$serie-$version/
fi

dh_make -a -s -y -f ../redmine-apijs-$version.tar.gz -p redmine-plugin-apijs

rm -f debian/*ex debian/*EX debian/README* debian/*doc* debian/deb.sh
rm -f debian/*ex debian/*EX debian/README* debian/*doc*
mkdir debian/upstream
rm debian/deb.sh
mv debian/metadata debian/upstream/metadata
mv debian/lintian debian/redmine-plugin-apijs.lintian-overrides



if [ $serie = "unstable" ]; then
if [ $serie = "experimental" ]; then
dpkg-buildpackage -us -uc
else
# debhelper: unstable:13 hirsute:13 focal:12 bionic:9 xenial:9 trusty:9
# debhelper: experimental:13 focal:12 bionic:9 xenial:9 trusty:9
if [ $serie = "focal" ]; then
sed -i 's/debhelper-compat (= 13)/debhelper-compat (= 12)/g' debian/control
fi
Expand All @@ -73,27 +74,27 @@ for serie in unstable jammy impish hirsute focal bionic xenial trusty; do
sed -i ':a;N;$!ba;s/Rules-Requires-Root: no\n//g' debian/control
echo 9 > debian/compat
fi
sed -i 's/unstable/'$serie'/g' debian/changelog
sed -i 's/experimental/'$serie'/g' debian/changelog
sed -i 's/-1) /-1+'$serie') /' debian/changelog
dpkg-buildpackage -us -uc -ui -d -S
fi
echo "==========================="
echo "=========================== debsign =="
cd ..

if [ $serie = "unstable" ]; then
# debian only
if [ $serie = "experimental" ]; then
# Debian only
debsign redmine-plugin-apijs_$version-*.changes
echo "==========================="
echo "=========================== lintian =="
lintian -EviIL +pedantic redmine-plugin-apijs_$version-*.deb
else
# ubuntu only
# Ubuntu only
debsign redmine-plugin-apijs_$version*+$serie*source.changes
fi
echo "==========================="
cd ..
done

ls -dltrh builder/*.deb builder/*.changes
ls -dlth "$PWD/"builder/*.deb "$PWD/"builder/*.changes
echo "==========================="

# cleanup
Expand Down
5 changes: 4 additions & 1 deletion opensuse/redmine-apijs.spec
@@ -1,7 +1,7 @@
%define basedir /srv/www/vhosts/redmine/
%define plugin_name redmine_apijs
Name: redmine-apijs
Version: 6.8.2
Version: 6.9.0
Release: 0
Summary: Plugin for Redmine to display a gallery from attachments
Summary(fr): Extension pour Redmine pour afficher une galerie à partir des pièces jointes
Expand Down Expand Up @@ -66,6 +66,9 @@ chmod +x %{buildroot}%{basedir}/plugins/%{plugin_name}/lib/*.py


%changelog
* Thu Jul 07 2022 Fabrice Creuzot <code@luigifab.fr> - 6.9.0-1
- New upstream release

* Sat Jan 01 2022 Fabrice Creuzot <code@luigifab.fr> - 6.8.2-1
- New upstream release

Expand Down
10 changes: 5 additions & 5 deletions opensuse/rpm.sh
Expand Up @@ -3,14 +3,14 @@


cd "$(dirname "$0")"
version="6.8.2"
version="6.9.0"


rm -rf builder/ ~/rpmbuild/
rm -rf builder/
mkdir -p builder ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}

# copy to a tmp directory
if [ true ]; then
if [ ! true ]; then
chmod 644 redmine-apijs.spec
spectool -g -R redmine-apijs.spec
else
Expand Down Expand Up @@ -41,8 +41,8 @@ rpm --checksig builder/*.rpm
echo "==========================="
rpmlint redmine-apijs.spec builder/*.rpm
echo "==========================="
ls -dltrh builder/*.rpm
ls -dlth "$PWD/"builder/*.rpm
echo "==========================="

# cleanup
rm -rf builder/*/ ~/rpmbuild/
rm -rf builder/*/
12 changes: 6 additions & 6 deletions rubygem/gem.sh
@@ -1,9 +1,9 @@
#!/bin/bash
# debian: sudo apt install ruby
# Debian: sudo apt install ruby


cd "$(dirname "$0")"
version="6.8.2"
version="6.9.0"
rm -rf builder/


Expand All @@ -18,8 +18,9 @@ cp -r ../src/lib builder/redmine_apijs-${version}/
cp ../src/init.rb builder/redmine_apijs-${version}/
cp ../src/readme builder/redmine_apijs-${version}/README
cp Gemfile builder/redmine_apijs-${version}/
cp redmine_apijs.gemspec builder/redmine_apijs-${version}/
cp /usr/share/common-licenses/GPL-2 builder/redmine_apijs-${version}/LICENSE
cp redmine_apijs.gemspec builder/redmine_apijs-${version}/
cp redmine_apijs.rb builder/redmine_apijs-${version}/lib/
cp /usr/share/common-licenses/GPL-2 builder/redmine_apijs-${version}/LICENSE
sed -i 's/'${version}'/'${version}-gem'/g' builder/redmine_apijs-${version}/init.rb
sed -i 's/x.y.z/'${version}'/g' builder/redmine_apijs-${version}/redmine_apijs.gemspec
find builder/redmine_apijs-${version}/ -type f | xargs chmod +r
Expand All @@ -29,14 +30,13 @@ find builder/redmine_apijs-${version}/ -type f | xargs chmod +r




# create package (https://guides.rubygems.org/make-your-own-gem/)
cd builder/redmine_apijs-${version}/
gem build redmine_apijs.gemspec
cd ../..
mv builder/redmine_apijs-${version}/*.gem .
echo "==========================="
ls -dltrh $PWD/*.gem
ls -dlth $PWD/*.gem
echo "==========================="

# cleanup
Expand Down
4 changes: 1 addition & 3 deletions rubygem/redmine_apijs.gemspec
Expand Up @@ -3,7 +3,7 @@ Gem::Specification.new do |s|
s.name = 'redmine_apijs'
s.version = 'x.y.z'
s.summary = 'Redmine Apijs plugin'
s.description = 'Integrate the apijs JavaScript library into Redmine. Provides a gallery for image and video attachments.'
s.description = 'Integrate the apijs JavaScript library into Redmine. Provides a gallery for image and video attachments. Gem for Redmine 3.0+ (tested with 3.0..5.0), for Redmine 4.1+, read https://redmine.org/issues/31110#note-8'
s.homepage = 'https://github.com/luigifab/redmine-apijs'
s.license = 'GPL-2.0-or-later'
s.authors = ['Fabrice Creuzot']
Expand Down Expand Up @@ -66,12 +66,10 @@ Gem::Specification.new do |s|
Gemfile
init.rb
lib/apijs_attachment.rb
lib/apijs_const.rb
lib/apijs_files.rb
lib/image.py
lib/redmine_apijs.rb
lib/useragentparser.rb
lib/video.py
LICENSE
README
redmine_apijs.gemspec
Expand Down
71 changes: 71 additions & 0 deletions rubygem/redmine_apijs.rb
@@ -0,0 +1,71 @@
# encoding: utf-8
# Created L/13/07/2020
# Updated M/05/07/2022
#
# Copyright 2008-2022 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
# https://www.luigifab.fr/redmine/apijs
#
# This program is free software, you can redistribute it or modify
# it under the terms of the GNU General Public License (GPL) as published
# by the free software foundation, either version 2 of the license, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but without any warranty, without even the implied warranty of
# merchantability or fitness for a particular purpose. See the
# GNU General Public License (GPL) for more details.

require 'rails/engine'

module RedmineApijs

class Plugin < ::Rails::Engine

config.after_initialize do

# for Redmine 5.0+ with Rails 6.0+
ENV['redmine_apijs_gem'] = 'yes'

# Gemify redmine plugin (based on https://github.com/koppen/redmine_github_hook/commit/a82bcccfd0731503509771d3f715d8fb1e6f1bfe)
# it works out of box with Redmine 3.0 - 4.0, for Redmine 4.1+ see https://www.redmine.org/issues/31110
# run the classic redmine plugin initializer after rails boot
require File.expand_path('../../init', __FILE__)
::ActionController::Base.prepend_view_path(File.expand_path('../../app/views/', __FILE__))

# and copy plugin assets
unless ::Redmine::Configuration['mirror_plugins_assets_on_startup'] == false
if Redmine::VERSION::MAJOR >= 5
# https://github.com/redmine/redmine/blob/9aa34eb651e2941aeae69cc3acf6e1c1b909729e/lib/redmine/plugin_loader.rb#L41
# Update the name of the plugin directory
module ::Redmine
class PluginPath
def update_dir(dir)
@dir = dir
end
end
end
# go
obj = Redmine::PluginPath.new(File.expand_path('../../', __FILE__))
obj.update_dir('redmine_apijs')
obj.mirror_assets
else
# https://github.com/redmine/redmine/blob/94f3510036690d049ac7425d19fa7c055044ae57/lib/redmine/plugin.rb#L207
# Returns the absolute path to the plugin assets directory
module ::Redmine
class Plugin
def assets_directory
if directory =~ /redmine_apijs/
File.join(File.expand_path('../../', __FILE__), 'assets')
else
File.join(directory, 'assets')
end
end
end
end
# go
Redmine::Plugin.mirror_assets('redmine_apijs')
end
end
end
end
end

0 comments on commit 255f56d

Please sign in to comment.