Skip to content

Conversation

@chinyeungli
Copy link
Contributor

@chinyeungli chinyeungli commented Nov 5, 2025

Fixed #340

Create a script to use Docker container to build a Fedora package.

Once the .rpm is generated, one can install the package by

sudo dnf install /path/to/<dejacode>.rpm

Once it's installed, one can run the binary directly

dejacode

I need the following to run the test after installed the debian package

Create and configure a PostgreSQL user named dejacode

psql -h localhost -U postgres -c "CREATE USER dejacode; ALTER USER dejacode CREATEDB; GRANT ALL PRIVILEGES ON DATABASE dejacode TO dejacode;" 2>/dev/null || psql -h localhost -U postgres -c "ALTER USER dejacode CREATEDB; GRANT ALL PRIVILEGES ON DATABASE dejacode TO dejacode;"

Sets up environment variables and runs a test

PGPASSWORD="password" SECRET_KEY=secret dejacode test
  • Replace the "password" with the PostgreSQL password

Output

thomas@DESKTOP-6IMEJ77:~$ cat /etc/os-release
NAME="Fedora Linux"
VERSION="42 (WSL)"
RELEASE_TYPE=stable
ID=fedora
VERSION_ID=42
VERSION_CODENAME=""
PLATFORM_ID="platform:f42"
PRETTY_NAME="Fedora Linux 42 (WSL)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:42"
DEFAULT_HOSTNAME="fedora"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f42/system-administrators-guide/"
SUPPORT_URL="https://ask.fedoraproject.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=42
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=42
SUPPORT_END=2026-05-13
VARIANT="WSL"
VARIANT_ID=wsl
thomas@DESKTOP-6IMEJ77:~$ dejacode

Type 'dejacode help <subcommand>' for help on a specific subcommand.

Available subcommands:

[django]
    check
    compilemessages
    createcachetable
    dbshell
    diffsettings
    dumpdata
    flush
    inspectdb
    loaddata
    makemessages
    makemigrations
    migrate
    optimizemigration
    runserver
    sendtestemail
    shell
    showmigrations
    sqlflush
    sqlmigrate
    sqlsequencereset
    squashmigrations
    startapp
    startproject
    test
    testserver
Note that only Django core commands are listed as settings are not properly configured (error: Set the SECRET_KEY environment variable).
thomas@DESKTOP-6IMEJ77:~$

Signed-off-by: Chin Yeung Li tli@nexb.com

Signed-off-by: Chin Yeung Li <tli@nexb.com>
Signed-off-by: Chin Yeung Li <tli@nexb.com>
Signed-off-by: Chin Yeung Li <tli@nexb.com>
Signed-off-by: Chin Yeung Li <tli@nexb.com>
Signed-off-by: Chin Yeung Li <tli@nexb.com>
Signed-off-by: Chin Yeung Li <tli@nexb.com>
Signed-off-by: Chin Yeung Li <tli@nexb.com>
- Removed building funcparserlib
- Changed BuildArch from noarch to x86_64
- Resolved dependencies issues

Signed-off-by: Chin Yeung Li <tli@nexb.com>
@tdruez
Copy link
Contributor

tdruez commented Nov 18, 2025

Tested the package build and package installation successfully:

$ python build_rpm_docker.py
...
Success! RPM built: dist/rpmbuild/RPMS/x86_64/python3-dejacode-5.4.1-1.fc42.x86_64.rpm
$ docker run -it -v $(pwd)/dist:/dist fedora:42 bash

# dnf install git postgresql postgresql-devel python3.13
# rpm -i dist/rpmbuild/RPMS/x86_64/python3-dejacode-5.4.1-1.fc42.x86_64.rpm

# dejacode
Type 'dejacode help <subcommand>' for help on a specific subcommand.

@tdruez tdruez merged commit c8f5a3f into main Nov 18, 2025
4 checks passed
@tdruez tdruez deleted the 340_packaging_for_fedora branch November 18, 2025 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CRAVEX-integration: Packaging for Fedora

2 participants