227 lines
6.2 KiB
Plaintext
227 lines
6.2 KiB
Plaintext
BuildFlags: excludebuild:ksplice
|
|
BuildFlags: excludebuild:qucs-qt5
|
|
|
|
%if "%_repository" == "15.7" || "%_repository" == "Fedora_40"
|
|
BuildFlags: excludebuild:clang-struct
|
|
%endif
|
|
%if "%_repository" == "15.7"
|
|
BuildFlags: excludebuild:tbtools
|
|
%endif
|
|
|
|
%if "%_repository" == "win32"
|
|
BuildFlags: onlybuild:mingw32-ifoxtrot-qt
|
|
BuildFlags: onlybuild:mingw32-ifoxtrot-qt-installer
|
|
%else
|
|
BuildFlags: excludebuild:mingw32-ifoxtrot-qt
|
|
BuildFlags: excludebuild:mingw32-ifoxtrot-qt-installer
|
|
%endif
|
|
%if "%_repository" == "win64"
|
|
BuildFlags: onlybuild:mingw64-ifoxtrot-qt
|
|
BuildFlags: onlybuild:mingw64-ifoxtrot-qt-installer
|
|
%else
|
|
BuildFlags: excludebuild:mingw64-ifoxtrot-qt
|
|
BuildFlags: excludebuild:mingw64-ifoxtrot-qt-installer
|
|
%endif
|
|
|
|
%if "%_repository" == "Fedora_40" || "%_repository" == "Fedora_41"
|
|
BuildFlags: excludebuild:tbtools
|
|
%endif
|
|
|
|
%if 0%{?fedora_version} >= 37
|
|
Substitute: libusb-devel libusb-compat-0.1-devel
|
|
%endif
|
|
%if 0%{?fedora_version} >= 24
|
|
Prefer: glibc-langpack-en
|
|
Substitute: pkg-config pkgconfig
|
|
Substitute: update-desktop-files
|
|
Substitute: libantlr4-runtime-devel antlr4-cpp-runtime-devel
|
|
Substitute: liblz4-devel lz4-devel
|
|
Substitute: libqt5-linguist qt5-linguist
|
|
Substitute: ninja ninja-build
|
|
Substitute: libprotobuf-c-devel protobuf-c-devel
|
|
|
|
Macros:
|
|
%make_jobs \
|
|
make %{?_smp_mflags} VERBOSE=1
|
|
|
|
%qmake5 \
|
|
qmake-qt5 \\\
|
|
QMAKE_CXXFLAGS="$CXXFLAGS %{optflags} -DOPENSSL_LOAD_CONF" \\\
|
|
QMAKE_CFLAGS="$CFLAGS %{optflags} -DOPENSSL_LOAD_CONF" \\\
|
|
QMAKE_LFLAGS="$LDFLAGS -Wl,--as-needed -Wl,--no-undefined"
|
|
|
|
%qmake5_install \
|
|
make STRIP=/bin/true INSTALL_ROOT=%{buildroot} install
|
|
|
|
%qt6_build %cmake_build
|
|
|
|
%qt6_install %cmake_install
|
|
|
|
%suse_update_desktop_file() %{nil}
|
|
|
|
%perl_requires() %{nil}
|
|
|
|
%__builddir %__cmake_builddir
|
|
|
|
%__python /usr/bin/python3
|
|
%python_module() python3-%{**}
|
|
|
|
%python_subpackages \
|
|
%package python3 \
|
|
Summary: Python bindings for %{name} \
|
|
\
|
|
%description python3 \
|
|
Python bindings for %{name}.
|
|
|
|
%python_files python3
|
|
|
|
%_pyproject_wheeldir ./build
|
|
%pyproject_wheel_args \\\
|
|
--verbose --progress-bar off --disable-pip-version-check \\\
|
|
%{?py_setup_args:--build-option %{py_setup_args}} \\\
|
|
--use-pep517 --no-build-isolation \\\
|
|
--no-deps \\\
|
|
--wheel-dir %{_pyproject_wheeldir}
|
|
|
|
%pyproject_install_args \\\
|
|
--verbose --progress-bar off --disable-pip-version-check \\\
|
|
--root %{buildroot} \\\
|
|
--no-compile \\\
|
|
--ignore-installed --no-deps \\\
|
|
--no-index --find-links %{_pyproject_wheeldir}
|
|
|
|
%pyproject_wheel(+abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-=) \
|
|
myargs="%{**}" \
|
|
%__python3 -mpip wheel %{pyproject_wheel_args} ${myargs:-.}
|
|
|
|
%pyproject_install(+abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-=) \
|
|
myargs="%{**}" \
|
|
ls %{_pyproject_wheeldir}/*.whl || (mkdir -p %{_pyproject_wheeldir}/; cp *.whl %{_pyproject_wheeldir}/) \
|
|
for w in %{_pyproject_wheeldir}/*.whl; do \
|
|
myargs="$myargs $(echo $(basename ${w}) | sed -E 's/([^-]+)-([^-]+)-.+\\.whl/\\1==\\2/')" \
|
|
done \
|
|
%__python3 -mpip install %{pyproject_install_args} $myargs \
|
|
%python3_compile \
|
|
%python3_fix_shebang
|
|
|
|
%python3_compile \
|
|
for d in %{buildroot}%{python3_sitelib} %{buildroot}%{python3_sitearch}; do \
|
|
if [ -d $d ]; then \
|
|
find $d -iname '*.pyc' -delete \
|
|
find $d -iname '*.py' -print0 | xargs -0 %__python3 -c ' \
|
|
import sys, py_compile \
|
|
for f in sys.argv[1:]: \
|
|
fp=f[len("%{buildroot}"):] \
|
|
print("Generating cached byte-code for " + str(fp)) \
|
|
if sys.version[0] == "2": \
|
|
py_compile.compile(f, dfile=fp) \
|
|
else: \
|
|
for o in [0, 1]: \
|
|
py_compile.compile(f, dfile=fp, optimize=o) \
|
|
' \
|
|
fi \
|
|
done
|
|
|
|
%python3_fix_shebang \
|
|
%python3_fix_shebang_path %{buildroot}%{_bindir}/* %{buildroot}%{_sbindir}/*
|
|
|
|
%python3_fix_shebang_path(+abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-=) \
|
|
myargs="%{**}" \
|
|
for f in ${myargs}; do \
|
|
if [ -f "$f" -a -x "$f" -a -w "$f" ] \
|
|
then \
|
|
# in i586 sed fails when following symlinks to long paths, so \
|
|
# changing to the target directory avoid this problem \
|
|
pushd $(dirname $f) \
|
|
sed -i --follow-symlinks "1s@#\\!.*python\\S*@#\\!$(realpath %__python3)@" "$(basename $f)" \
|
|
popd \
|
|
fi \
|
|
done
|
|
|
|
|
|
%perl_gen_filelist(n)\
|
|
FILES=%{name}.files\
|
|
# fgen_dir func\
|
|
# IN: dir\
|
|
fgen_dir(){\
|
|
%{__cat} >> $FILES << EOF\
|
|
%dir ${1}\
|
|
EOF\
|
|
}\
|
|
# fgen_file func\
|
|
# IN: file\
|
|
fgen_file(){\
|
|
%{__cat} >> $FILES << EOF\
|
|
${1}\
|
|
EOF\
|
|
}\
|
|
# check for files in %{perl_vendorlib}\
|
|
RES=`find ${RPM_BUILD_ROOT}%{perl_vendorlib} -maxdepth 1 -type f`\
|
|
if [ -n "$RES" ]; then\
|
|
for file in $RES; do\
|
|
fgen_file "%{perl_vendorlib}/$(basename ${file})"\
|
|
done\
|
|
fi\
|
|
\
|
|
# get all dirs into array\
|
|
base_dir="${RPM_BUILD_ROOT}%{perl_vendorlib}/"\
|
|
for dir in `find ${base_dir} -type d | sort`; do\
|
|
if [ "$dir" = "${base_dir}" ]; then\
|
|
continue\
|
|
else\
|
|
el=${dir#$base_dir}\
|
|
all_dir=(${all_dir[@]} $el)\
|
|
fi\
|
|
done\
|
|
\
|
|
# build filelist\
|
|
for i in ${all_dir[@]}; do\
|
|
# do not add "dir {perl_vendorlib/arch}/auto", included in perl package\
|
|
if [ "${i}" = "auto" ]; then\
|
|
continue\
|
|
fi\
|
|
if [ "%{perl_vendorlib}/${i}" = "%{perl_vendorarch}/auto" ]; then\
|
|
continue\
|
|
else\
|
|
if [ -d ${base_dir}/${i} ]; then\
|
|
if [ "%{perl_vendorlib}/${i}" != "%{perl_vendorarch}" ]; then\
|
|
fgen_dir "%{perl_vendorlib}/${i}"\
|
|
fi\
|
|
RES=`find "${base_dir}/${i}" -maxdepth 1 -type f`\
|
|
for file in $RES; do\
|
|
fgen_file "%{perl_vendorlib}/${i}/$(basename ${file})"\
|
|
done\
|
|
fi\
|
|
fi\
|
|
done\
|
|
# add man pages\
|
|
# if exist :)\
|
|
if [ -d "${RPM_BUILD_ROOT}%{_mandir}" ]; then\
|
|
for file in `cd "${RPM_BUILD_ROOT}%{_mandir}" && find . -type f -name "*3pm*"`; do \
|
|
if test -e "%{_mandir}/$file" -o -e "%{_mandir}/$file.gz"; then \
|
|
mv ${RPM_BUILD_ROOT}%{_mandir}/$file ${RPM_BUILD_ROOT}%{_mandir}/${file/3pm/3pmc} \
|
|
fi \
|
|
done \
|
|
fgen_file "%{_mandir}/man?/*"\
|
|
fi\
|
|
\
|
|
# add packlist file\
|
|
# generated fom perllocal.pod\
|
|
if [ -f "${RPM_BUILD_ROOT}/var/adm/perl-modules/%{name}" ]; then\
|
|
fgen_file "/var/adm/perl-modules/%{name}"\
|
|
fi\
|
|
\
|
|
# check for files in %{_bindir}\
|
|
if [ -d ${RPM_BUILD_ROOT}%{_bindir} ]; then\
|
|
RES=`find "${RPM_BUILD_ROOT}%{_bindir}" -maxdepth 1 -type f`\
|
|
if [ -n "$RES" ]; then\
|
|
for file in $RES; do\
|
|
fgen_file "%{_bindir}/$(basename ${file})"\
|
|
done\
|
|
fi\
|
|
fi
|
|
|
|
|
|
:Macros
|
|
%endif
|