Skip to content

Instantly share code, notes, and snippets.

@mohan43u
Created June 14, 2023 21:07
Show Gist options
  • Save mohan43u/4ffcb5968be890c186018620b799d522 to your computer and use it in GitHub Desktop.
Save mohan43u/4ffcb5968be890c186018620b799d522 to your computer and use it in GitHub Desktop.
Fac Patch
diff --git a/Makefile.in b/Makefile.in
index a54f468..42c9c79 100755
--- a/Makefile.in
+++ b/Makefile.in
@@ -19,7 +19,7 @@ CFLAGS = @CPPFLAGS@ @CFLAGS@
LIBS = @LDFLAGS@ @LIBS@ @FLIBS@
-all: lib sfac
+all: lib sfac pfac mpy
lib:
cd blas; make
@@ -49,16 +49,16 @@ doc:
demo:
cd demo; make
-install:
+install: install-pfac install-mpy
cd sfac; make install
install-pfac:
- ${PYTHON} setup.py install -ccompiler="${CC}"
+ ${PYTHON} setup.py install -ccompiler="${CC}" --prefix=@prefix@ --root="${DESTDIR}" --install-layout=deb
install-mpy:
cd python; make install
-clean:
+clean: cleanfac
rm -f *.so *.a *.o *~
rm -rf build
cd lapack; make clean
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..5c51917
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+fac (0v1.1.4.r671.g826139f) unstable; urgency=medium
+
+ * Initial Release.
+
+ -- unknown <user0@unknown> Wed, 14 Jun 2023 19:27:03 +0200
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..47787bf
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,14 @@
+Source: fac
+Section: unknown
+Priority: optional
+Maintainer: Mohan R <[email protected]>
+Build-Depends: debhelper-compat (= 12), autotools-dev, python2-dev, gfortran
+Standards-Version: 4.4.1
+Homepage: https://github.com/flexible-atomic-code/fac
+#Vcs-Browser: https://salsa.debian.org/debian/fac
+#Vcs-Git: https://salsa.debian.org/debian/fac.git
+
+Package: fac
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: FAC - Flexible Atomic Code by Ming Feng Gu
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..6526f69
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,36 @@
+#!/usr/bin/make -f
+# See debhelper(7) (uncomment to enable)
+# output every command that modifies files on the build system.
+export DH_VERBOSE = 1
+
+
+# see FEATURE AREAS in dpkg-buildflags(1)
+#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+
+# see ENVIRONMENT in dpkg-buildflags(1)
+# package maintainers to append CFLAGS
+#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
+# package maintainers to append LDFLAGS
+#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
+
+
+%:
+ dh $@
+
+
+# dh_make generated override targets
+# This is example for Cmake (See https://bugs.debian.org/641051 )
+#override_dh_auto_configure:
+# dh_auto_configure -- # -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)
+
+override_dh_autoreconf:
+ test configure
+
+override_dh_auto_clean:
+ -make clean
+
+override_dh_auto_configure:
+ ./configure --prefix=/usr
+
+override_dh_auto_build:
+ make all
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..89ae9db
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (native)
diff --git a/python/Makefile.in b/python/Makefile.in
index 42563e0..cd0d432 100755
--- a/python/Makefile.in
+++ b/python/Makefile.in
@@ -21,8 +21,8 @@ mpy: mpy.c
${CC} -o mpy ${CPPFLAGS} ${CFLAGS} mpy.c ${LDFLAGS} ${LIBS}
install:
- ${INSTALL} -d ${BINDIR}
- ${INSTALL} mpy ${BINDIR}
+ ${INSTALL} -d ${DESTDIR}/${BINDIR}
+ ${INSTALL} mpy ${DESTDIR}/${BINDIR}
clean:
rm -rf *.o *~ mpy
diff --git a/setup.py b/setup.py
index b13c0ba..761bb47 100755
--- a/setup.py
+++ b/setup.py
@@ -121,7 +121,7 @@ for s in x:
elif (s[0:6] == '-bsfac'):
bsfac = 'SFAC-%s.%s.tar'%(VERSION, get_platform())
elif (s[0:4] == '-mpy'):
- pyinc = sysconfig.et_config_var('INCLUDEPY')
+ pyinc = sysconfig.get_config_var('INCLUDEPY')
pylib = (sysconfig.get_config_var('LIBPL') +
'/' + sysconfig.get_config_var('LDLIBRARY'))
os.system('cd python; export PYINC=%s PYLIB=%s; make mpy'%(pyinc, pylib))
diff --git a/sfac/Makefile.in b/sfac/Makefile.in
index 3991dda..ddb3396 100755
--- a/sfac/Makefile.in
+++ b/sfac/Makefile.in
@@ -27,10 +27,10 @@ spol: spol.c stoken.c ${TOPDIR}/libfac.a
$(CC) -o spol spol.c stoken.c ${ALL_CFLAGS}
install:
- ${INSTALL} -d ${BINDIR}
- ${INSTALL} sfac ${BINDIR}
- ${INSTALL} scrm ${BINDIR}
- ${INSTALL} spol ${BINDIR}
+ ${INSTALL} -d ${DESTDIR}/${BINDIR}
+ ${INSTALL} sfac ${DESTDIR}/${BINDIR}
+ ${INSTALL} scrm ${DESTDIR}/${BINDIR}
+ ${INSTALL} spol ${DESTDIR}/${BINDIR}
clean:
rm -rf *.o *~ sfac scrm spol
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment