Skip to content
Snippets Groups Projects
Commit 9cb485b0 authored by nfg's avatar nfg
Browse files

upgpkg: 6.7.6, icu76 rebuild for real

parent b1d5e279
Branches master
No related tags found
No related merge requests found
Pipeline #83249 passed
a
b
patch-prepare.sh
patch-make.sh
\ No newline at end of file
patch-make.sh
migrate.sh
migrate_upstream.sh
\ No newline at end of file
[submodule "brltty"]
path = brltty
url = https://gitlab.archlinux.org/archlinux/packaging/packages/brltty
branch = main
path = brltty
url = https://gitlab.archlinux.org/archlinux/packaging/packages/brltty
branch = main
update = merge
README.md 0 → 100644
Template for automatically tracking and building a package when the upstream Arch Linux project upgrade a new tag.
This template allow to rebuild a required by package if needed.
This can only be used at `Obcore` and `Obextra` repository. If you want to add a package to `Obcommunity`, use the [prototype-pkg](https://git.obarun.org/pkg/prototype-pkg) instead.
We are using the `acpid` package as an example. Therefore, substitute `acpid` with the one you require.
# Install for a new project
## Create a clone
Make a clone of this [repository](https://git.obarun.org/pkg/prototype-apkg)
```
git clone https://git.obarun.org/pkg/prototype-apkg
```
Rename the directory `acpid` and go inside
```
mv prototype-apkg acpid
cd acpid
```
Destroy the .git directory
```
rm -rf .git
```
Initiate a fresh git repository
```
git init --initial-branch=master
```
## Configure the git remote origin
We need to define where is the remote origin of the repository. To do so
```
git remote add origin ssh://git@git.obarun.org:22023/pkg/obextra/acpid.git
```
The `ssh` access is preferable but if you may want to use https instead of ssh, just replace the address by
```
git remote add origin https://git.obarun.org/pkg/obextra/acpid.git
```
## Prepare the submodule
Edit the .gitmodules file and replace `<project_name>` by the name of the package, in our case `acpid`.
The final file should be:
```
[submodule "acpid"]
path = acpid
url = https://gitlab.archlinux.org/archlinux/packaging/packages/acpid
branch = main
update = merge
```
Now we need to add to git `refs` of the submodule to the project.
```
git submodule add -b main https://gitlab.archlinux.org/archlinux/packaging/packages/acpid acpid
git submodule update --init
git submodule update --remote --merge
```
## Prepare the necessary directories
**Do not forget to execute the command above before continuing. The patch-prepare.sh assume that the submodule already exist.**
Execute
```
./patch-prepare.sh acpid
```
This command create the necessary directories as the following
```
.
├── README.md
├── a
│ ├── PKGBUILD
│ ├── acpid.service
│ ├── anything
│ └── handler.sh
├── acpid
│ ├── PKGBUILD
│ ├── acpid.service
│ ├── anything
│ └── handler.sh
├── b
│ ├── PKGBUILD
│ ├── acpid.service
│ ├── anything
│ └── handler.sh
├── diff
│ ├── file
│ ├── patch
│ └── rebuild
├── pacman.conf.builder
├── patch-make.sh
├── patch-prepare.sh
└── pkg.cfg
```
### `a` and `b` directories
As you can see the `a` and `b` directories are strict copy of the submodule directory `acpid`.
#### `a` directory
You should never touch this directory. This is the original one used by `patch-make.sh` script to create the patch. So, leave it as it.
#### `b` directory
This is the directory where you make changes.
**Do not forget**, we talk about the preparation for a patch. So, trying to remove/adding files **has no effects**. Only changes contains of files.
## Make the patch file
When you are done with your changes, execute
```
./patch-make.sh acpid
```
This command will create a patch file at `diff/patch/PKG.patch` will somehting similar too (depending of your changes at `b` directory)
```
diff -uar a/PKGBUILD b/PKGBUILD
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -16,7 +16,6 @@
replaces=('acpid2')
backup=('etc/acpi/handler.sh' 'etc/acpi/events/anything')
source=("https://downloads.sourceforge.net/sourceforge/acpid2/$pkgname-$pkgver.tar.xz"
- 'acpid.service'
'anything'
'handler.sh')
sha256sums=('2d095c8cfcbc847caec746d62cdc8d0bff1ec1bc72ef7c674c721e04da6ab333'
@@ -38,8 +37,7 @@
install -Dm644 ../anything "$pkgdir/etc/acpi/events/anything"
install -Dm755 ../handler.sh "$pkgdir/etc/acpi/handler.sh"
- # systemd
- install -Dm644 ../acpid.service "$pkgdir/usr/lib/systemd/system/acpid.service"
+
}
# vim:set ts=2 sw=2 et:
```
This patch will be applied before any build.
## Add, commit and push to the repository project
This is the final step. Simply add, commit and push your project to the remote one.
```
git add .
git commit -m "First commit"
git push -u origin master
```
## Make the project publicly accessible
Make sure that the project is publicly accessible. To do so:
Connect to [`gitlab`](https://git.obarun.org) obarun instance.
- On the left sidebar, select **Search or go to** and find your project.
- Select **Settings** > **General**.
- Expand **Visibility, project features, permissions**
- Under **Project visibility** pick **public** at drop-down menu.
## Schedule the project
Connect to [`gitlab`](https://git.obarun.org) obarun instance.
- On the left sidebar, select **Search or go to** and find your project.
- Select **Build** > **Pipeline schedules**.
- Select **New schedule** and fill the form. *Consider at least 24hours between schedule update*.
See complete gitlab [documentation](https://docs.gitlab.com/ee/ci/pipelines/schedules.html#add-a-pipeline-schedule) about pipeline schedule.
# diff directory explanation
This directory can be used to add files or other patch files depending of your needs.
It also allow you to define packages that need to be rebuild if `acpid` get a new tag from Arch upstream.
## diff/file
This directory is used to add extra files to the build directory. For example you may want to add a `acpid.install` file. This is the good place to do it. Simply add any files that you want and a verbatim copy will be made at `acpid` submodule directory before any build.
## diff/patch
This directory contains patch files as `PKG.patch` created automatically previously. You can place any patch file that you want is this directory but you need to conform to the `-Np1` option used by the runner script to patch the files. So, be sure to conform to this rule.
## diff/rebuild
This directory is used to define which packages need to be rebuild against a new project tag.
For instance, if `acpid` receives a new tag, you might also consider rebuilding `vte3`. Please note that this example is not meaningful as `vte3` does not have `acpid` as a dependency. It is provided purely for illustrative purposes.
In this scenario, just generate an empty file using the following syntax: `path@of@project`, where `@` substitutes for `/`.
For example create an empty file `pkg@obextra@vte3`.
```
touch diff/rebuild/pkg@obextra@vte3
```
At execution time the `@` will be replaced by `/` to retrieve the path of the projects `https://git.obarun.org/pkg/obextra/vte3`.
Create one file by project.
# Update an existing project
Go to a temporary directory, clone this template project.
```
cd /tmp
git clone ssh://git@git.obarun.org:22023/pkg/prototype-apkg.git
```
Remove the .git directory
```
cd prototype-apkg
rm -rf .git
```
Go to your local project directory to migrate. Obviously, replace the `/home/obarun/pkg/local/obcore/acpid` path with our specific path in this example.
```
cd /home/obarun/pkg/local/obcore/acpid
```
Remove all files and directories ***execpt*** the `.git` directory, we want to keep the history of the project.
```
find . -maxdepth 1 ! -name '.git' -type d -not -path '.' -exec rm -rf {} +
find . -maxdepth 1 -type f -exec rm -rf {} +
```
Copy the templates files to your local project directory.
```
cp -rT /tmp/prototype-apkg .
```
Clean up the template clone directory
```
rm -rf /tmp/prototype-apkg
```
Follow the [Prepare the submodule](#prepare-the-submodule), [Prepare the necessary directories](#prepare-the-necessary-directories), [Make the patch file](#make-the-patch-file) and [Schedule the project](#schedule-the-project) instructions.
finally, Add, commit and push your changes
```
git add .
git commit -m"update to new format"
git push
```
# Reverse Patch Process
## Clone the Project
Begin by cloning the project from the Obarun GitLab instance using the following command:
```
git clone --recurse-submodules acpid
```
## Copy Patch Preparation Files
Copy the patch-prepare.sh and patch-make.sh files from the original [template](https://git.obarun.org/pkg/prototype-apkg).
Make sure these files are made executable. You can use the chmod command to do this:
```
chmod +x patch-prepare.sh patch-make.sh
```
## Execute the Patch Preparation Script
Run the `patch-prepare.sh` script, specifying the project name as an argument. This can be done as follows:
```
./patch-prepare.sh acpid
```
Change directory to the b/ directory:
```
cd b/
```
## Apply the Patch to the `PKGBUILD` File
Use the patch command to apply the patch to the `PKGBUILD` file. Be sure to specify the correct path to the PKG.patch patch file in the diff/patch/ directory. Using `-Np1` indicates the level of directory to skip in the patch path:
```
patch -Np1 -i ../diff/patch/PKG.patch
```
# Upgrading the Patch
Ensure that you are in the root directory of your project.
Execute the following command to fetch all the latest changes from the project repository:
```
git pull
```
Update the submodules using the following command to fetch the latest changes from the project's submodules:
```
git submodule update --remote --merge
```
Use the `patch-prepare.sh` script, specifying your project's name to prepare the patch. This can be done as follows:
```
./patch-prepare.sh acpid
```
Navigate to the `b/` directory where you need to can make changes to the necessary files.
Once you have made the required changes, execute the `patch-make.sh` script to finalize the patch:
```
./patch-make.sh
```
If desired, check the changes with the `git diff` command.
Add the changes to the staging area with the following command:
```
git add .
```
Commit the changes with an informative message regarding the patch update:
```
git commit -m "Update patch"
```
Finally, push the changes to your own Git repository using the command:
```
git push
```
diff -uar a/PKGBUILD b/PKGBUILD
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -7,7 +7,7 @@
pkgbase=brltty
pkgname=(brltty brltty-udev-generic)
pkgver=6.7
-pkgrel=5
+pkgrel=6
pkgdesc="Braille display driver for Linux/Unix"
arch=(x86_64)
url="https://brltty.app"
@@ -20,7 +20,7 @@
bluez-libs
cython
......@@ -26,8 +35,8 @@ diff -uar a/PKGBUILD b/PKGBUILD
)
optdepends=(
'at-spi2-core: X11/GNOME Apps accessibility'
@@ -132,9 +130,7 @@
cd $pkgbase-$pkgver
@@ -131,9 +129,7 @@
cd $pkgbase-${pkgbase^^}-$pkgver
# installation does not work reliably with many cores, so set jobs to 1
make -j1 INSTALL_ROOT="$pkgdir" install
- make -j1 INSTALL_ROOT="$pkgdir" install-systemd
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment