summaryrefslogtreecommitdiff
path: root/lpsolve.spec
diff options
context:
space:
mode:
Diffstat (limited to 'lpsolve.spec')
-rw-r--r--lpsolve.spec70
1 files changed, 70 insertions, 0 deletions
diff --git a/lpsolve.spec b/lpsolve.spec
new file mode 100644
index 0000000..a4f1d17
--- /dev/null
+++ b/lpsolve.spec
@@ -0,0 +1,70 @@
+Name: lpsolve
+Summary: A Mixed Integer Linear Programming (MILP) solver
+Version: 5.5.2.0
+Release: 1
+Source: http://downloads.sourceforge.net/lpsolve/lp_solve_%{version}_source.tar.gz
+URL: http://sourceforge.net/projects/lpsolve
+License: LGPLv2+
+
+BuildRequires: gcc-c++
+
+Patch0: lpsolve-5.5.0.11.cflags.patch
+Patch1: lpsolve-5.5.2.0.defines.patch
+Patch2: lpsolve-ccc-c99.patch
+
+%description
+Mixed Integer Linear Programming (MILP) solver lpsolve solves pure linear,
+(mixed) integer/binary, semi-continuous and special ordered sets (SOS) models.
+
+%package devel
+Requires: %{name}%{?_isa} = %{version}-%{release}
+Summary: Files for developing with lpsolve
+
+%description devel
+Includes and definitions for developing with lpsolve
+
+%prep
+%setup -q -n lp_solve_5.5
+%patch0 -p1 -b .cflags.patch
+%patch1 -p1 -b .defines.patch
+%patch2 -p1 -b .ccc-c99.patch
+
+%build
+%set_build_flags
+cd lpsolve55
+# fix for obs
+mkdir -p tmp
+sed -i "s#/tmp#tmp#g" ccc
+# end fix for obs
+sh -x ccc
+rm bin/ux*/liblpsolve55.a
+cd ../lp_solve
+# fix for obs
+mkdir -p tmp
+sed -i "s#/tmp#tmp#g" ccc
+# end fix for obs
+sh -x ccc
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT%{_bindir} $RPM_BUILD_ROOT%{_libdir} $RPM_BUILD_ROOT%{_includedir}/lpsolve
+install -p -m 755 \
+ lp_solve/bin/ux*/lp_solve $RPM_BUILD_ROOT%{_bindir}
+install -p -m 755 \
+ lpsolve55/bin/ux*/liblpsolve55.so $RPM_BUILD_ROOT%{_libdir}
+install -p -m 644 \
+ lp*.h $RPM_BUILD_ROOT%{_includedir}/lpsolve
+
+%ldconfig_scriptlets
+
+%files
+%doc README.txt ./bfp/bfp_LUSOL/LUSOL/LUSOL_LGPL.txt ./bfp/bfp_LUSOL/LUSOL/LUSOL_README.txt ./bfp/bfp_LUSOL/LUSOL/LUSOL-overview.txt
+%{_bindir}/lp_solve
+%{_libdir}/*.so
+
+%files devel
+%{_includedir}/lpsolve
+
+%changelog
+* Wed Sep 06 2023 Darssin <2020303249@mail.nwpu.edu.cn> - 5.5.2.0-1
+- Package init