Write spec file for rpm package of fpc (free pascal compiler).
- User
Write spec file for rpm package of fpc (free pascal compiler).
- Assistant
Write spec file for rpm package of fpc (free pascal compiler).
Creating a spec file for an RPM package involves specifying metadata about the package, its dependencies, installation instructions, and files that will be included in the package. Below is a sample spec file for the Free Pascal Compiler (FPC). You may need to adjust certain values based on the specific version you're packaging and your build environment.
Name: fpc
Version: 3.2.2
Release: 1%{?dist}
Summary: Free Pascal Compiler
License: GPLv2+
URL: https://www.freepascal.org/
Source0: fpc-%{version}.tar.gz
BuildRequires: make
BuildRequires: gcc
BuildRequires: binutils
BuildRequires: fpc-source >= %{version}
Requires: fpc-source >= %{version}
%description
Free Pascal is a powerful and versatile multi-platform Pascal compiler. It supports various platforms, including Windows, Linux, macOS, and many others. Features include an extensive library, an integrated development environment, and support for object-oriented programming, among others.
%prep
%setup -q -c
%build
make all
%install
mkdir -p %{buildroot}/usr/bin
install -m 0755 fpc %{buildroot}/usr/bin/
mkdir -p %{buildroot}/usr/share/doc/fpc
cp -r docs/* %{buildroot}/usr/share/doc/fpc/
%files
/usr/bin/fpc
/usr/share/doc/fpc/*
%changelog
* Thu Oct 12 2023 Your Name <youremail@example.com> - 3.2.2-1
- Initial RPM release of Free Pascal Compiler.
Name, Version, Release: These fields define the name of the package, its version, and the release number.
Summary: A brief description of the package.
License: License under which the software is released.
URL: The homepage of Free Pascal Compiler.
Source0: The source archive for the specific version of FPC being packaged. Ensure that this source is available in the appropriate location when building the RPM.
BuildRequires: List of dependencies required to build the package.
Requires: Dependencies that will be needed at runtime.
%description: A more detailed description of the package.
%prep, %build, %install: Sections for preparing the build environment, compiling the package, and installing files into the build root.
%files: A list of files that are included in the package.
%changelog: Log of changes made to the package over time.
fpc-%{version}.tar.gz with the actual source file name if it differs.%install section as necessary to match your build structure.