Skip to content

Commit

Permalink
deb cleanup (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
David Coutadeur committed Aug 1, 2024
1 parent cc3601d commit 926fad4
Show file tree
Hide file tree
Showing 17 changed files with 277 additions and 80 deletions.
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,10 @@
"cp -R vendor/fortawesome/font-awesome/webfonts htdocs/vendor/font-awesome",
"rm -rf vendor/fortawesome/font-awesome"
]
},
"require-dev": {
"phpunit/phpunit": ">=8",
"php-mock/php-mock-phpunit": "*",
"mockery/mockery": ">=1.4"
}
}
13 changes: 9 additions & 4 deletions docs/general-parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ General parameters
Configuration files
-------------------

The default configuration file is ``conf/config.inc.php``, it contains all default values.
To edit configuration, you should create ``conf/config.inc.local.php`` and override needed parameters:
The default configuration file is ``/etc/service-desk/config.inc.php``, it contains all default values.
To edit configuration, you should create ``/etc/service-desk/config.inc.local.php`` and override needed parameters:

.. code-block:: php
Expand All @@ -29,7 +29,7 @@ This feature is disable by default. To enable it:
$header_name_extra_config = "SSP-Extra-Config";
Then if you send the header ``SSP-Extra-Config: domain1``, the file
``conf/config.inc.domain1.php`` will be loaded.
``/etc/service-desk/config.inc.domain1.php`` will be loaded.

Using Apache, we may set such header using the following:

Expand Down Expand Up @@ -64,7 +64,12 @@ Set default language in ``$lang``:
$lang = "en";
.. tip:: You can override messages by creating lang files in ``conf/``, for example ``conf/en.inc.php``.
.. tip:: You can override messages by creating lang files in configuration directory:

* ``conf/`` directory for service-desk archive
* ``/etc/service-desk`` directory for rpm/deb packages

For example, you can create a customized file: ``/etc/service-desk/en.inc.php``.

Language is picked according to browser choice among the available ones. All languages
are allowed by default, to restrict them add ``$allowed_lang`` array:
Expand Down
7 changes: 4 additions & 3 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ You need to install these prerequisites:
* Apache or another web server
* php
* php-ldap
* Smarty (version 3)
* php-fpm
* smarty (version 3 or 4)

Debian / Ubuntu
---------------
Expand Down Expand Up @@ -54,12 +55,12 @@ You are now ready to install:

.. prompt:: bash #

apt install service-desk smarty3
apt install service-desk smarty4

CentOS / RedHat
---------------

.. warning:: You may need to install first the package `php-Smarty`_ which is not in official repositories.
.. warning:: You must install the package `php-Smarty`_. You can get it from EPEL repositories.

.. _php-Smarty: https://pkgs.org/download/php-Smarty

Expand Down
74 changes: 74 additions & 0 deletions docs/upgrade.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,80 @@ Upgrade
From 0.5 to 0.6
---------------

bundled dependencies
~~~~~~~~~~~~~~~~~~~~

The dependencies are now explicitly listed in the service-desk package, including the bundled ones.

You can find bundled dependencies list:

* in package description in debian package
* in Provides field in rpm package


configuration
~~~~~~~~~~~~~

The configuration files are now in ``/etc/service-desk`` directory.

During the upgrade process towards 0.6, the previous configuration files present in ``/usr/share/service-desk/conf`` (all .php files) are migrated to ``/etc/service-desk/``:

* ``config.inc.php`` is migrated as a ``config.inc.php.bak`` file,
* all other php file names are preserved. (including local conf, domain conf, and customized lang files)

Please take in consideration that ``config.inc.php`` is now replaced systematically by the version in the RPM package. A .rpmsave backup will be done with the current version. The deb package will continue asking which file to use, it is advised to replace the current one with the version in the package.

Avoid as much as possible editing the ``/etc/service-desk/config.inc.php`` file. Prefer modifying the ``/etc/service-desk/config.inc.local.php``.

cache cleaning
~~~~~~~~~~~~~~

Now the cache is being cleaned-up during service-desk upgrade / install.

This is intended to avoid smarty problems due to service-desk templates upgrade, and possibly smarty upgrade itself.


dependencies update
~~~~~~~~~~~~~~~~~~~

Packaged dependencies:

* smarty is now a required package. service-desk will work with either version 3 or 4.
* php >= 7.3 is now required
* php-fpm is a now a required dependency
* php-ldap has been kept as dependency

Bundled dependencies:

* js-bootstrap has been updated from version v3.4.1 to version v5.3.2
* js-jquery has been updated from version v1.10.2 to version v3.7.1
* js-datatables.net-datatables.net has been updated from version 1.10.16 to version 2.1.2
* js-datatables.net-datatables.net-bs5 has been updated from version 1.10.16 to version 2.0.8
* js-datatables.net-datatables.net-buttons has been updated from version 1.5.1 to version 3.1.0
* js-datatables.net-datatables.net-buttons-bs5 has been updated from version 1.5.1 to version 3.0.2
* fontawesome-fonts has been updated from version 4.7.0 to version 6.5.2
* php-ltb-project-ltb-common has been updated from version 0.1 to version 0.3.0
* php-phpmailer has been updated from version 6.8.0 to version v6.9.1

Removed bundled dependencies:

.. code-block::
myclabs/deep-copy, doctrine/instantiator,
nikic/php-parser, phar-io/version, phpunit/php-code-coverage, phpunit/phpunit,
phpunit/php-timer, phpunit/php-invoker, phpunit/php-text-template,
phpunit/php-file-iterator, sebastian/recursion-context,
sebastian/version, sebastian/complexity, sebastian/environment,
sebastian/object-enumerator, sebastian/global-state,
sebastian/resource-operations, sebastian/comparator,
sebastian/exporter, sebastian/type, sebastian/code-unit,
sebastian/lines-of-code, sebastian/diff, sebastian/object-reflector,
sebastian/code-unit-reverse-lookup, sebastian/cli-parser, theseer/tokenizer
Note that hidden files (.gitignore,...) from bundled dependencies are now removed from packages.



Last authentication time and idle accounts
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
60 changes: 0 additions & 60 deletions packaging/README

This file was deleted.

110 changes: 110 additions & 0 deletions packaging/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# Some notes on packaging Service Desk

## 0 - Version update

Update version in following files:

* htdocs/index.php
* packaging/rpm/SPECS/service-desk.spec
* packaging/debian/changelog

## 1 - Update dependencies and run tests

From the service-desk root directory, run:

```
composer update
```

Run tests:

```
XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-text --configuration tests/phpunit.xml
```

After the tests, remove the useless dependencies:

```
composer update --no-dev
```

## 2 - Archive tar.gz

From current directory, do:

```
./makedist.sh VERSION
```

with VERSION the current verion of the package

For example:

```
./makedist.sh 0.6
```


## 2 - Debian

Form current directory, do:

```
dpkg-buildpackage -b -kLTB
```

If you do not have LTB GPG secret key, do:

```
dpkg-buildpackage -b -us -uc
```

## 3 - RPM (RHEL, CentOS, Fedora, ...)

Prepare your build environment, for example in /home/clement/build.

You should have a ~/.rpmmacros like this:

```
%_topdir /home/clement/build
%dist .el5
%distribution .el5
%_signature gpg
%_gpg_name 6D45BFC5
%_gpgbin /usr/bin/gpg
%packager Clement OUDOT <[email protected]>
%vendor LTB-project
```

Copy packaging files from current directory to build directory:

```
cp -Ra rpm/* /home/clement/build
```

Copy Self Service Archive to SOURCES/:

```
cp ltb-project-service-desk-VERSION.tar.gz /home/clement/build/SOURCES
```

Go in build directory and build package:

```
cd /home/clement/build
rpmbuild -ba SPECS/service-desk.spec
```

Sign RPM:

```
rpm --addsign RPMS/noarch/service-desk*
```

## 4 - Docker

From current directory, do:

```
docker build -t service-desk -f ./docker/Dockerfile ../
```
6 changes: 6 additions & 0 deletions packaging/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
ltb-project-service-desk (0.6.0-1) unstable; urgency=low

* gh#142: deb cleanup

-- Clement Oudot <[email protected]> Wed, 31 Jul 2024 12:00:00 +0200

ltb-project-service-desk (0.5.1-1) unstable; urgency=low

* gh#92: Message override broken in 0.5
Expand Down
2 changes: 1 addition & 1 deletion packaging/debian/compat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9
11
2 changes: 0 additions & 2 deletions packaging/debian/conffiles

This file was deleted.

12 changes: 11 additions & 1 deletion packaging/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,18 @@ Standards-Version: 3.8.3
Homepage: http://ltb-project.org/wiki/documentation/service-desk

Package: service-desk
Depends: php5|php, php5-ldap|php-ldap
Depends: php (>= 7.3), php-ldap, php-fpm, smarty4 | smarty3
Architecture: all
Description: LDAP Tool Box Service Desk web interface
Service Desk is a PHP application that allows administrators to check, unlock and reset user passwords in an LDAP directory.
Service Desk is provided by LDAP Tool Box project: https://ltb-project.org
Service Desk bundles some dependencies:
- js-bootstrap = v5.3.2
- js-jquery = v3.7.1
- js-datatables.net-datatables.net = 2.1.2
- js-datatables.net-datatables.net-bs5 = 2.0.8
- js-datatables.net-datatables.net-buttons = 3.1.0
- js-datatables.net-datatables.net-buttons-bs5 = 3.0.2
- fontawesome-fonts = 6.5.2
- php-ltb-project-ltb-common = 0.3.0
- php-phpmailer = v6.9.1
11 changes: 7 additions & 4 deletions packaging/debian/copyright
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@ Maintainer: Clement Oudot <[email protected]>
Source: http://ltb-project.org/wiki/documentation/service-desk

Files: htdocs/vendor/bootstrap
Copyright: 2011-2014 Twitter, Inc.
Copyright: Copyright (c) 2011-2024 The Bootstrap Authors

Files: htdocs/vendor/font-awesome
Copyright: @davegandy - http://fontawesome.io - @fontawesome
Copyright: Font Awesome by Dave Gandy - http://fontawesome.io

Files: htdocs/vendor/jquery
Copyright: 2005, 2013 jQuery Foundation, Inc.
Copyright: Copyright OpenJS Foundation and other contributors, https://openjsf.org/

Files: htdocs/vendor/datatables
Copyright: Copyright (C) 2008-2024, SpryMedia Ltd.

Files: *
Copyright: 2020 LTB-Project, Worteks, Clement Oudot
Copyright: 2024 LTB-Project, Worteks, Clement Oudot, David Coutadeur

License: GPL
This program is free software; you can redistribute it and/or modify
Expand Down
Loading

0 comments on commit 926fad4

Please sign in to comment.