markdown · 3793 bytes Raw Blame History

AUR Packaging Guide for FORTRESS

This guide explains how to package FORTRESS for the Arch User Repository (AUR).

Files Needed for AUR

The following files are required in the AUR repository:

  1. PKGBUILD - Build script that describes how to build and install the package
  2. .SRCINFO - Metadata file generated from PKGBUILD
  3. fortress.install - Post-install messages and scripts

Preparing for AUR Submission

1. Create a Release on GitHub

First, create a tagged release on GitHub:

# Tag the release
git tag -a v0.1.0 -m "Release v0.1.0"
git push origin v0.1.0

Then create a release on GitHub using this tag.

2. Generate Checksum

Download the release tarball and generate its SHA256 checksum:

# Download the release
wget https://github.com/FortranGoingOnForty/fortress/archive/v0.1.0.tar.gz

# Generate checksum
sha256sum v0.1.0.tar.gz

Update the sha256sums line in PKGBUILD with this value.

3. Test the PKGBUILD

Before submitting to AUR, test the build locally:

# Install dependencies (if not already installed)
sudo pacman -S fpm gcc-fortran base-devel

# Test build
makepkg -sf

# Test installation
sudo pacman -U fortress-0.1.0-1-x86_64.pkg.tar.zst

# Test the installed package
fortress

4. Generate .SRCINFO

The .SRCINFO file must be generated from PKGBUILD:

makepkg --printsrcinfo > .SRCINFO

Important: Regenerate .SRCINFO every time you update PKGBUILD!

5. Submit to AUR

If this is your first time:

# Clone the AUR repository (will be empty initially)
git clone ssh://aur@aur.archlinux.org/fortress.git aur-fortress
cd aur-fortress

# Copy the required files
cp ../PKGBUILD .
cp ../fortress.install .
makepkg --printsrcinfo > .SRCINFO

# Commit and push
git add PKGBUILD fortress.install .SRCINFO
git commit -m "Initial import of fortress v0.1.0"
git push

For updates:

cd aur-fortress

# Update PKGBUILD (bump pkgver, update sha256sums, etc.)
# Then regenerate .SRCINFO
makepkg --printsrcinfo > .SRCINFO

# Commit and push
git add PKGBUILD .SRCINFO
git commit -m "Update to v0.2.0"
git push

How Installation Works

When users install fortress from AUR:

  1. Binary Installation: The executable is installed as /usr/bin/fortress-bin

  2. Shell Integration (automatic for most shells):

    • Bash: Auto-loaded from /etc/profile.d/fortress.sh on shell startup
    • Fish: Auto-loaded from /usr/share/fish/vendor_functions.d/fortress.fish
    • Zsh: Users need to add source /usr/share/fortress/fortress.sh to ~/.zshrc
  3. Usage: Users just run fortress and the cd-on-exit feature works automatically

Testing Shell Integration

After installation, test each shell:

# Bash
bash
fortress  # Should work, press 'c' to cd

# Fish
fish
fortress  # Should work, press 'c' to cd

# Zsh (after sourcing)
zsh
source /usr/share/fortress/fortress.sh
fortress  # Should work, press 'c' to cd

Maintaining the AUR Package

Version Updates

  1. Update pkgver in PKGBUILD
  2. Update sha256sums with new release checksum
  3. Test build: makepkg -sf
  4. Regenerate .SRCINFO: makepkg --printsrcinfo > .SRCINFO
  5. Commit and push to AUR

Common Issues

fpm not in official repos: Users need to install fpm from AUR first:

yay -S fpm

Build fails: Check that all makedepends are correct and the build() function works

Shell integration doesn't work: Verify files are installed to correct locations and users have restarted their shell

Resources

View source
1 # AUR Packaging Guide for FORTRESS
2
3 This guide explains how to package FORTRESS for the Arch User Repository (AUR).
4
5 ## Files Needed for AUR
6
7 The following files are required in the AUR repository:
8
9 1. **PKGBUILD** - Build script that describes how to build and install the package
10 2. **.SRCINFO** - Metadata file generated from PKGBUILD
11 3. **fortress.install** - Post-install messages and scripts
12
13 ## Preparing for AUR Submission
14
15 ### 1. Create a Release on GitHub
16
17 First, create a tagged release on GitHub:
18
19 ```bash
20 # Tag the release
21 git tag -a v0.1.0 -m "Release v0.1.0"
22 git push origin v0.1.0
23 ```
24
25 Then create a release on GitHub using this tag.
26
27 ### 2. Generate Checksum
28
29 Download the release tarball and generate its SHA256 checksum:
30
31 ```bash
32 # Download the release
33 wget https://github.com/FortranGoingOnForty/fortress/archive/v0.1.0.tar.gz
34
35 # Generate checksum
36 sha256sum v0.1.0.tar.gz
37 ```
38
39 Update the `sha256sums` line in PKGBUILD with this value.
40
41 ### 3. Test the PKGBUILD
42
43 Before submitting to AUR, test the build locally:
44
45 ```bash
46 # Install dependencies (if not already installed)
47 sudo pacman -S fpm gcc-fortran base-devel
48
49 # Test build
50 makepkg -sf
51
52 # Test installation
53 sudo pacman -U fortress-0.1.0-1-x86_64.pkg.tar.zst
54
55 # Test the installed package
56 fortress
57 ```
58
59 ### 4. Generate .SRCINFO
60
61 The .SRCINFO file must be generated from PKGBUILD:
62
63 ```bash
64 makepkg --printsrcinfo > .SRCINFO
65 ```
66
67 **Important**: Regenerate .SRCINFO every time you update PKGBUILD!
68
69 ### 5. Submit to AUR
70
71 If this is your first time:
72
73 ```bash
74 # Clone the AUR repository (will be empty initially)
75 git clone ssh://aur@aur.archlinux.org/fortress.git aur-fortress
76 cd aur-fortress
77
78 # Copy the required files
79 cp ../PKGBUILD .
80 cp ../fortress.install .
81 makepkg --printsrcinfo > .SRCINFO
82
83 # Commit and push
84 git add PKGBUILD fortress.install .SRCINFO
85 git commit -m "Initial import of fortress v0.1.0"
86 git push
87 ```
88
89 For updates:
90
91 ```bash
92 cd aur-fortress
93
94 # Update PKGBUILD (bump pkgver, update sha256sums, etc.)
95 # Then regenerate .SRCINFO
96 makepkg --printsrcinfo > .SRCINFO
97
98 # Commit and push
99 git add PKGBUILD .SRCINFO
100 git commit -m "Update to v0.2.0"
101 git push
102 ```
103
104 ## How Installation Works
105
106 When users install fortress from AUR:
107
108 1. **Binary Installation**: The executable is installed as `/usr/bin/fortress-bin`
109
110 2. **Shell Integration** (automatic for most shells):
111 - **Bash**: Auto-loaded from `/etc/profile.d/fortress.sh` on shell startup
112 - **Fish**: Auto-loaded from `/usr/share/fish/vendor_functions.d/fortress.fish`
113 - **Zsh**: Users need to add `source /usr/share/fortress/fortress.sh` to `~/.zshrc`
114
115 3. **Usage**: Users just run `fortress` and the cd-on-exit feature works automatically
116
117 ## Testing Shell Integration
118
119 After installation, test each shell:
120
121 ```bash
122 # Bash
123 bash
124 fortress # Should work, press 'c' to cd
125
126 # Fish
127 fish
128 fortress # Should work, press 'c' to cd
129
130 # Zsh (after sourcing)
131 zsh
132 source /usr/share/fortress/fortress.sh
133 fortress # Should work, press 'c' to cd
134 ```
135
136 ## Maintaining the AUR Package
137
138 ### Version Updates
139
140 1. Update `pkgver` in PKGBUILD
141 2. Update `sha256sums` with new release checksum
142 3. Test build: `makepkg -sf`
143 4. Regenerate .SRCINFO: `makepkg --printsrcinfo > .SRCINFO`
144 5. Commit and push to AUR
145
146 ### Common Issues
147
148 **fpm not in official repos**: Users need to install `fpm` from AUR first:
149 ```bash
150 yay -S fpm
151 ```
152
153 **Build fails**: Check that all makedepends are correct and the build() function works
154
155 **Shell integration doesn't work**: Verify files are installed to correct locations and users have restarted their shell
156
157 ## Resources
158
159 - [AUR Submission Guidelines](https://wiki.archlinux.org/title/AUR_submission_guidelines)
160 - [PKGBUILD Manual](https://wiki.archlinux.org/title/PKGBUILD)
161 - [Creating Packages](https://wiki.archlinux.org/title/Creating_packages)